From 6a2c9774801d2239548a71f750fb5cefc582aac9 Mon Sep 17 00:00:00 2001 From: "Mountain/\\Ash" Date: Mon, 11 Mar 2024 13:29:17 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=91=B7=20Added=20emojis=20for=20easier=20?= =?UTF-8?q?log=20debugging.=20Replace=20backticks=20where=20not=20needed?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dist/index.js | 18 +++++++++--------- src/helpers.js | 6 +++--- src/index.js | 10 +++++----- src/vercel.js | 2 +- 4 files changed, 18 insertions(+), 18 deletions(-) diff --git a/dist/index.js b/dist/index.js index 666148f5..4ab4966b 100644 --- a/dist/index.js +++ b/dist/index.js @@ -30984,11 +30984,11 @@ const core = __nccwpck_require__(2186) const { spawn } = __nccwpck_require__(2081) const execCmd = (command, args, cwd) => { - core.debug(`EXEC: "${ command } ${ args }" in ${ cwd || '.' }`) + core.info(`▶︎ EXEC: "${ command } ${ args }" in ${ cwd || '.' }`) return new Promise((resolve, reject) => { const process = spawn(command, args, { cwd }) - let stdout - let stderr + let stdout = '▲ ' + let stderr = '🔺 ' process.stdout.on('data', (data) => { core.debug(data.toString()) @@ -31111,7 +31111,7 @@ const init = () => { const output = await exec('vercel', commandArguments, WORKING_DIRECTORY) const parsed = output.match(/(?<=https?:\/\/)(.*)/g)[0] - if (!parsed) throw new Error('Could not parse deploymentUrl') + if (!parsed) throw new Error('🛑 Could not parse deploymentUrl') deploymentUrl = parsed @@ -31260,7 +31260,7 @@ const run = async () => { } try { - core.info(`Creating deployment with Vercel CLI`) + core.info('Creating deployment with Vercel CLI') const vercel = Vercel.init() const commit = ATTACH_COMMIT_METADATA ? await github.getCommit() : undefined @@ -31270,10 +31270,10 @@ 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`) + throw new Error('🛑 invalid type for PR_PREVIEW_DOMAIN') } const alias = PR_PREVIEW_DOMAIN.replace('{USER}', urlSafeParameter(USER)) @@ -31308,10 +31308,10 @@ const run = async () => { } if (ALIAS_DOMAINS) { - core.info(`Assigning custom domains to Vercel deployment`) + core.info('Assigning custom domains to Vercel deployment') if (!Array.isArray(ALIAS_DOMAINS)) { - throw new Error(`invalid type for PR_PREVIEW_DOMAIN`) + throw new Error('🛑 invalid type for ALIAS_DOMAINS') } for (let i = 0; i < ALIAS_DOMAINS.length; i++) { diff --git a/src/helpers.js b/src/helpers.js index 325322e3..96ff5836 100644 --- a/src/helpers.js +++ b/src/helpers.js @@ -2,11 +2,11 @@ const core = require('@actions/core') const { spawn } = require('child_process') const execCmd = (command, args, cwd) => { - core.debug(`EXEC: "${ command } ${ args }" in ${ cwd || '.' }`) + core.info(`▶︎ EXEC: "${ command } ${ args }" in ${ cwd || '.' }`) return new Promise((resolve, reject) => { const process = spawn(command, args, { cwd }) - let stdout - let stderr + let stdout = '▲ ' + let stderr = '🔺 ' process.stdout.on('data', (data) => { core.debug(data.toString()) diff --git a/src/index.js b/src/index.js index d8a3d486..0a12e4de 100644 --- a/src/index.js +++ b/src/index.js @@ -60,7 +60,7 @@ const run = async () => { } try { - core.info(`Creating deployment with Vercel CLI`) + core.info('Creating deployment with Vercel CLI') const vercel = Vercel.init() const commit = ATTACH_COMMIT_METADATA ? await github.getCommit() : undefined @@ -70,10 +70,10 @@ 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`) + throw new Error('🛑 invalid type for PR_PREVIEW_DOMAIN') } const alias = PR_PREVIEW_DOMAIN.replace('{USER}', urlSafeParameter(USER)) @@ -108,10 +108,10 @@ const run = async () => { } if (ALIAS_DOMAINS) { - core.info(`Assigning custom domains to Vercel deployment`) + core.info('Assigning custom domains to Vercel deployment') if (!Array.isArray(ALIAS_DOMAINS)) { - throw new Error(`invalid type for PR_PREVIEW_DOMAIN`) + throw new Error('🛑 invalid type for ALIAS_DOMAINS') } for (let i = 0; i < ALIAS_DOMAINS.length; i++) { diff --git a/src/vercel.js b/src/vercel.js index 1a904caf..5966f95d 100644 --- a/src/vercel.js +++ b/src/vercel.js @@ -74,7 +74,7 @@ const init = () => { const output = await exec('vercel', commandArguments, WORKING_DIRECTORY) const parsed = output.match(/(?<=https?:\/\/)(.*)/g)[0] - if (!parsed) throw new Error('Could not parse deploymentUrl') + if (!parsed) throw new Error('🛑 Could not parse deploymentUrl') deploymentUrl = parsed