diff --git a/CHANGELOG.md b/CHANGELOG.md
index 164044ad..b92854c6 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,9 +1,10 @@
# Change Log
-## [2.3.3] - 2024-05-07
+## [2.4.0] - 2024-05-07
- BUG: checking for empty, "false" and "null" ALIAS's as strings
- ๐งน refactor of deploymentURLs (URLs are now a named object, not a number positioned array)
+- Comments & Summary don't show empty rows
## [2.3.2] - 2024-05-07
diff --git a/dist/index.js b/dist/index.js
index 7abb3c0e..394b3f54 100644
--- a/dist/index.js
+++ b/dist/index.js
@@ -32678,7 +32678,7 @@ const run = async () => {
}
}
- deploymentURLs.all = deploymentURLs.unique
+ deploymentURLs.all.push(deploymentURLs.unique)
deploymentURLs.all.push(deploymentURLs.preview)
deploymentURLs.all = deploymentURLs.all.concat(deploymentURLs.aliases)
@@ -32703,15 +32703,15 @@ const run = async () => {
if (CREATE_COMMENT) {
core.info('Creating new comment on PR ๐ฌ')
- const body = `This pull request (commit \`${ SHA.substring(0, 7) }\`) has been deployed to Vercel โฒ - [View GitHub Actions Workflow Logs](${ LOG_URL })
+ let commentMD = `This pull request (commit \`${ SHA.substring(0, 7) }\`) has been deployed to Vercel โฒ - [View GitHub Actions Workflow Logs](${ LOG_URL })
| Name | Link |
-| :--- | :--- |
-| ๐ Preview | <${ deploymentURLs.preview }> |
-| ๐ Unique | <${ deploymentURLs.unique }> |
-| ๐ Inspect | <${ deploymentURLs.inspector }> |`
+| :--- | :--- |`
+ commentMD += deploymentURLs.preview ? `| ๐ Preview | <${ deploymentURLs.preview }> |` : ''
+ commentMD += deploymentURLs.unique ? `| ๐ Unique | <${ deploymentURLs.unique }> |` : ''
+ commentMD += deploymentURLs.inspector ? `| ๐ Inspect | <${ deploymentURLs.inspector }> |` : ''
- const comment = await github.createComment(body)
+ const comment = await github.createComment(commentMD)
core.info(`Comment created: ${ comment.html_url }`)
}
@@ -32722,25 +32722,26 @@ const run = async () => {
}
}
- core.setOutput('PREVIEW_URL', deploymentURLs.preview)
- core.setOutput('DEPLOYMENT_URLS', deploymentURLs.all)
- core.setOutput('DEPLOYMENT_UNIQUE_URL', deploymentURLs.unique)
- core.setOutput('DEPLOYMENT_ID', deployment.id)
- core.setOutput('DEPLOYMENT_INSPECTOR_URL', deploymentURLs.inspector)
- core.setOutput('DEPLOYMENT_CREATED', true)
- core.setOutput('COMMENT_CREATED', IS_PR && CREATE_COMMENT)
+ let summaryMD = `## Deploy to Vercel โฒ
- const summaryMD = `## Deploy to Vercel โฒ
| Name | Link |
-| :--- | :--- |
-| ๐ Preview | <${ deploymentURLs.preview }> |
-| ๐ Unique | <${ deploymentURLs.unique }> |
-| ๐ Others | ${ deploymentURLs.aliases.join('
') } |
-| ๐ Inspect | <${ deploymentURLs.inspector }> |`
+| :--- | :--- |`
+ summaryMD += deploymentURLs.preview ? `| ๐ Preview | <${ deploymentURLs.preview }> |` : ''
+ summaryMD += deploymentURLs.unique ? `| ๐ Unique | <${ deploymentURLs.unique }> |` : ''
+ summaryMD += deploymentURLs.aliases.length ? `| ๐ Others | ${ deploymentURLs.aliases.join('
') } |` : ''
+ summaryMD += deploymentURLs.inspector ? `| ๐ Inspect | <${ deploymentURLs.inspector }> |` : ''
await core.summary.addRaw(summaryMD).write()
- // Set environment variable for use in subsequent job steps
+ // Set environment variables for use in subsequent job steps
+ core.setOutput('DEPLOYMENT_CREATED', true)
+ core.setOutput('DEPLOYMENT_ID', deployment.id)
+ core.setOutput('PREVIEW_URL', deploymentURLs.preview)
+ core.setOutput('DEPLOYMENT_UNIQUE_URL', deploymentURLs.unique)
+ core.setOutput('DEPLOYMENT_URLS', deploymentURLs.all)
+ core.setOutput('DEPLOYMENT_INSPECTOR_URL', deploymentURLs.inspector)
+ core.setOutput('COMMENT_CREATED', IS_PR && CREATE_COMMENT)
+
core.exportVariable('VERCEL_PREVIEW_URL', deploymentURLs.preview)
core.exportVariable('VERCEL_DEPLOYMENT_UNIQUE_URL', deploymentURLs.unique)
diff --git a/src/index.js b/src/index.js
index fd794294..8b5ddc45 100644
--- a/src/index.js
+++ b/src/index.js
@@ -143,7 +143,7 @@ const run = async () => {
}
}
- deploymentURLs.all = deploymentURLs.unique
+ deploymentURLs.all.push(deploymentURLs.unique)
deploymentURLs.all.push(deploymentURLs.preview)
deploymentURLs.all = deploymentURLs.all.concat(deploymentURLs.aliases)
@@ -168,15 +168,15 @@ const run = async () => {
if (CREATE_COMMENT) {
core.info('Creating new comment on PR ๐ฌ')
- const body = `This pull request (commit \`${ SHA.substring(0, 7) }\`) has been deployed to Vercel โฒ - [View GitHub Actions Workflow Logs](${ LOG_URL })
+ let commentMD = `This pull request (commit \`${ SHA.substring(0, 7) }\`) has been deployed to Vercel โฒ - [View GitHub Actions Workflow Logs](${ LOG_URL })
| Name | Link |
-| :--- | :--- |
-| ๐ Preview | <${ deploymentURLs.preview }> |
-| ๐ Unique | <${ deploymentURLs.unique }> |
-| ๐ Inspect | <${ deploymentURLs.inspector }> |`
+| :--- | :--- |`
+ commentMD += deploymentURLs.preview ? `| ๐ Preview | <${ deploymentURLs.preview }> |` : ''
+ commentMD += deploymentURLs.unique ? `| ๐ Unique | <${ deploymentURLs.unique }> |` : ''
+ commentMD += deploymentURLs.inspector ? `| ๐ Inspect | <${ deploymentURLs.inspector }> |` : ''
- const comment = await github.createComment(body)
+ const comment = await github.createComment(commentMD)
core.info(`Comment created: ${ comment.html_url }`)
}
@@ -187,25 +187,26 @@ const run = async () => {
}
}
- core.setOutput('PREVIEW_URL', deploymentURLs.preview)
- core.setOutput('DEPLOYMENT_URLS', deploymentURLs.all)
- core.setOutput('DEPLOYMENT_UNIQUE_URL', deploymentURLs.unique)
- core.setOutput('DEPLOYMENT_ID', deployment.id)
- core.setOutput('DEPLOYMENT_INSPECTOR_URL', deploymentURLs.inspector)
- core.setOutput('DEPLOYMENT_CREATED', true)
- core.setOutput('COMMENT_CREATED', IS_PR && CREATE_COMMENT)
+ let summaryMD = `## Deploy to Vercel โฒ
- const summaryMD = `## Deploy to Vercel โฒ
| Name | Link |
-| :--- | :--- |
-| ๐ Preview | <${ deploymentURLs.preview }> |
-| ๐ Unique | <${ deploymentURLs.unique }> |
-| ๐ Others | ${ deploymentURLs.aliases.join('
') } |
-| ๐ Inspect | <${ deploymentURLs.inspector }> |`
+| :--- | :--- |`
+ summaryMD += deploymentURLs.preview ? `| ๐ Preview | <${ deploymentURLs.preview }> |` : ''
+ summaryMD += deploymentURLs.unique ? `| ๐ Unique | <${ deploymentURLs.unique }> |` : ''
+ summaryMD += deploymentURLs.aliases.length ? `| ๐ Others | ${ deploymentURLs.aliases.join('
') } |` : ''
+ summaryMD += deploymentURLs.inspector ? `| ๐ Inspect | <${ deploymentURLs.inspector }> |` : ''
await core.summary.addRaw(summaryMD).write()
- // Set environment variable for use in subsequent job steps
+ // Set environment variables for use in subsequent job steps
+ core.setOutput('DEPLOYMENT_CREATED', true)
+ core.setOutput('DEPLOYMENT_ID', deployment.id)
+ core.setOutput('PREVIEW_URL', deploymentURLs.preview)
+ core.setOutput('DEPLOYMENT_UNIQUE_URL', deploymentURLs.unique)
+ core.setOutput('DEPLOYMENT_URLS', deploymentURLs.all)
+ core.setOutput('DEPLOYMENT_INSPECTOR_URL', deploymentURLs.inspector)
+ core.setOutput('COMMENT_CREATED', IS_PR && CREATE_COMMENT)
+
core.exportVariable('VERCEL_PREVIEW_URL', deploymentURLs.preview)
core.exportVariable('VERCEL_DEPLOYMENT_UNIQUE_URL', deploymentURLs.unique)