Skip to content

Commit

Permalink
πŸ› better check of "falsey" strings
Browse files Browse the repository at this point in the history
  • Loading branch information
mountainash authored May 7, 2024
1 parent 97a9906 commit e50a539
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 11 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Change Log

## [2.3.3] - 2024-05-07

- BUG: checking for "false" and "null" ALIAS's as strings

## [2.3.2] - 2024-05-07

- Unique domain added to PR comment
Expand Down
9 changes: 5 additions & 4 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -32641,21 +32641,22 @@ const run = async () => {

if (ALIAS_DOMAINS.length) {
core.info('Assigning alias domains to deployment 🌐')
core.debug(`ALIAS_DOMAINS ${ ALIAS_DOMAINS }`)

if (!Array.isArray(ALIAS_DOMAINS)) {
throw new Error('πŸ›‘ ALIAS_DOMAINS should be in array format')
}

for (let i = 0; i < ALIAS_DOMAINS.length; i++) {
ALIAS_DOMAINS.forEach(async (aliasDomain) => {
// check for "falsey" can often be null and empty values
if (!ALIAS_DOMAINS[i]) continue
if (!aliasDomain || aliasDomain.toLowerCase() === 'false' || aliasDomain.toLowerCase() === 'null') return

const alias = aliasFormatting(ALIAS_DOMAINS[i])
const alias = aliasFormatting(aliasDomain)

await vercel.assignAlias(alias)

deploymentUrls.push(addSchema(alias))
}
})
}

deploymentUrls.push(addSchema(deploymentUrl))
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "deploy-to-vercel-action",
"version": "2.3.2",
"version": "2.3.3",
"description": "Deploy your project to Vercel using GitHub Actions. Supports PR previews and GitHub deployments.",
"type": "commonjs",
"main": "dist/index.js",
Expand Down
9 changes: 5 additions & 4 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,21 +106,22 @@ const run = async () => {

if (ALIAS_DOMAINS.length) {
core.info('Assigning alias domains to deployment 🌐')
core.debug(`ALIAS_DOMAINS ${ ALIAS_DOMAINS }`)

if (!Array.isArray(ALIAS_DOMAINS)) {
throw new Error('πŸ›‘ ALIAS_DOMAINS should be in array format')
}

for (let i = 0; i < ALIAS_DOMAINS.length; i++) {
ALIAS_DOMAINS.forEach(async (aliasDomain) => {
// check for "falsey" can often be null and empty values
if (!ALIAS_DOMAINS[i]) continue
if (!aliasDomain || aliasDomain.toLowerCase() === 'false' || aliasDomain.toLowerCase() === 'null') return

const alias = aliasFormatting(ALIAS_DOMAINS[i])
const alias = aliasFormatting(aliasDomain)

await vercel.assignAlias(alias)

deploymentUrls.push(addSchema(alias))
}
})
}

deploymentUrls.push(addSchema(deploymentUrl))
Expand Down

0 comments on commit e50a539

Please sign in to comment.