From 8993566927542774af0c73de49ce330f174ff714 Mon Sep 17 00:00:00 2001 From: "Mountain/\\Ash" Date: Tue, 12 Mar 2024 01:03:05 +0100 Subject: [PATCH] :nail_care: More emojis in Logs. Fix for no Labels set. Proper table formatting --- README.md | 2 ++ dist/index.js | 28 ++++++++++++++-------------- src/index.js | 28 ++++++++++++++-------------- 3 files changed, 30 insertions(+), 28 deletions(-) diff --git a/README.md b/README.md index bf99d201..4cb46c71 100644 --- a/README.md +++ b/README.md @@ -14,6 +14,8 @@ - [x] Exporting `VERCEL_PREVIEW_URL` and `VERCEL_DEPLOYMENT_UNIQUE_URL` for use in other job steps - [x] Using @actions/core to correctly get boolean and multilined inputs - [x] Removed default "deploy" label from PRs +- [x] More emojis in logs 📝 +- [x] Better accessability formatting for comment table --- diff --git a/dist/index.js b/dist/index.js index 3c1e4eb6..0bf2bdf9 100644 --- a/dist/index.js +++ b/dist/index.js @@ -32509,7 +32509,7 @@ const run = async () => { core.info(`Deployment #${ ghDeployment.id } created`) await github.updateDeployment('pending') - core.info(`Deployment #${ ghDeployment.id } status changed to "pending"`) + core.info(`Deployment #${ ghDeployment.id } status changed to "pending" ⌛`) } try { @@ -32523,7 +32523,7 @@ const run = async () => { const deploymentUrls = [] if (IS_PR && PR_PREVIEW_DOMAIN) { - core.info('Assigning custom preview domain to PR') + core.info('Assigning custom preview domain to PR 🌐') if (typeof PR_PREVIEW_DOMAIN !== 'string') { throw new Error('🛑 invalid type for PR_PREVIEW_DOMAIN') @@ -32543,7 +32543,7 @@ const run = async () => { let prefix = alias.substring(0, alias.indexOf(previewDomainSuffix)) if (prefix.length >= 60) { - core.warning(`The alias ${ prefix } exceeds 60 chars in length, truncating using vercel's rules. See https://vercel.com/docs/concepts/deployments/automatic-urls#automatic-branch-urls`) + core.warning(`⚠️ The alias ${ prefix } exceeds 60 chars in length, truncating using vercel's rules. See https://vercel.com/docs/concepts/deployments/automatic-urls#automatic-branch-urls`) prefix = prefix.substring(0, 55) const uniqueSuffix = crypto.createHash('sha256') .update(`git-${ BRANCH }-${ REPOSITORY }`) @@ -32561,7 +32561,7 @@ const run = async () => { } if (ALIAS_DOMAINS) { - core.info('Assigning alias domains to Vercel ▲ deployment') + core.info('Assigning alias domains to deployment 🌐') if (!Array.isArray(ALIAS_DOMAINS)) { throw new Error('🛑 invalid type for ALIAS_DOMAINS') @@ -32588,48 +32588,48 @@ const run = async () => { core.info(`Deployment "${ deployment.id }" available at: ${ deploymentUrls.join(', ') }`) if (GITHUB_DEPLOYMENT) { - core.info('Changing GitHub deployment status to "success"') + core.info('Changing GitHub deployment status to "success" ✔︎') await github.updateDeployment('success', previewUrl) } if (IS_PR) { if (DELETE_EXISTING_COMMENT) { - core.info('Checking for existing comment on PR') + core.info('Checking for existing comment on PR 🔎') const deletedCommentId = await github.deleteExistingComment() if (deletedCommentId) - core.info(`Deleted existing comment #${ deletedCommentId }`) + core.info(`Deleted existing comment #${ deletedCommentId } 🚮`) } if (CREATE_COMMENT) { - core.info('Creating new comment on PR') + core.info('Creating new comment on PR 💬') const body = ` This pull request has been deployed to Vercel. - + Latest commit: - + - +
Latest commit:${ SHA.substring(0, 7) }
✅ Preview:✅ Preview: ${ previewUrl }
🔍 Inspect:🔍 Inspect: ${ deployment.inspectorUrl }
- [View Workflow Logs](${ LOG_URL }) + [View GitHub Actions Workflow Logs](${ LOG_URL }) ` const comment = await github.createComment(body) core.info(`Comment created: ${ comment.html_url }`) } - if (PR_LABELS) { - core.info('Adding label(s) to PR') + if (PR_LABELS.length) { + core.info('Adding label(s) to PR 🏷️') const labels = await github.addLabel() core.info(`Label(s) "${ labels.map((label) => label.name).join(', ') }" added`) diff --git a/src/index.js b/src/index.js index d847d307..66634953 100644 --- a/src/index.js +++ b/src/index.js @@ -56,7 +56,7 @@ const run = async () => { core.info(`Deployment #${ ghDeployment.id } created`) await github.updateDeployment('pending') - core.info(`Deployment #${ ghDeployment.id } status changed to "pending"`) + core.info(`Deployment #${ ghDeployment.id } status changed to "pending" ⌛`) } try { @@ -70,7 +70,7 @@ const run = async () => { const deploymentUrls = [] if (IS_PR && PR_PREVIEW_DOMAIN) { - core.info('Assigning custom preview domain to PR') + core.info('Assigning custom preview domain to PR 🌐') if (typeof PR_PREVIEW_DOMAIN !== 'string') { throw new Error('🛑 invalid type for PR_PREVIEW_DOMAIN') @@ -90,7 +90,7 @@ const run = async () => { let prefix = alias.substring(0, alias.indexOf(previewDomainSuffix)) if (prefix.length >= 60) { - core.warning(`The alias ${ prefix } exceeds 60 chars in length, truncating using vercel's rules. See https://vercel.com/docs/concepts/deployments/automatic-urls#automatic-branch-urls`) + core.warning(`⚠️ The alias ${ prefix } exceeds 60 chars in length, truncating using vercel's rules. See https://vercel.com/docs/concepts/deployments/automatic-urls#automatic-branch-urls`) prefix = prefix.substring(0, 55) const uniqueSuffix = crypto.createHash('sha256') .update(`git-${ BRANCH }-${ REPOSITORY }`) @@ -108,7 +108,7 @@ const run = async () => { } if (ALIAS_DOMAINS) { - core.info('Assigning alias domains to Vercel ▲ deployment') + core.info('Assigning alias domains to deployment 🌐') if (!Array.isArray(ALIAS_DOMAINS)) { throw new Error('🛑 invalid type for ALIAS_DOMAINS') @@ -135,48 +135,48 @@ const run = async () => { core.info(`Deployment "${ deployment.id }" available at: ${ deploymentUrls.join(', ') }`) if (GITHUB_DEPLOYMENT) { - core.info('Changing GitHub deployment status to "success"') + core.info('Changing GitHub deployment status to "success" ✔︎') await github.updateDeployment('success', previewUrl) } if (IS_PR) { if (DELETE_EXISTING_COMMENT) { - core.info('Checking for existing comment on PR') + core.info('Checking for existing comment on PR 🔎') const deletedCommentId = await github.deleteExistingComment() if (deletedCommentId) - core.info(`Deleted existing comment #${ deletedCommentId }`) + core.info(`Deleted existing comment #${ deletedCommentId } 🚮`) } if (CREATE_COMMENT) { - core.info('Creating new comment on PR') + core.info('Creating new comment on PR 💬') const body = ` This pull request has been deployed to Vercel. - + Latest commit: - + - +
Latest commit:${ SHA.substring(0, 7) }
✅ Preview:✅ Preview: ${ previewUrl }
🔍 Inspect:🔍 Inspect: ${ deployment.inspectorUrl }
- [View Workflow Logs](${ LOG_URL }) + [View GitHub Actions Workflow Logs](${ LOG_URL }) ` const comment = await github.createComment(body) core.info(`Comment created: ${ comment.html_url }`) } - if (PR_LABELS) { - core.info('Adding label(s) to PR') + if (PR_LABELS.length) { + core.info('Adding label(s) to PR 🏷️') const labels = await github.addLabel() core.info(`Label(s) "${ labels.map((label) => label.name).join(', ') }" added`)