From b3cde51fb1b1b04927ff484ec895bbef808956fe Mon Sep 17 00:00:00 2001 From: "Mountain/\\Ash" Date: Mon, 11 Mar 2024 20:53:14 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A8=20fixes=20from=20#232?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dist/index.js | 12 ++++++------ src/config.js | 2 +- src/vercel.js | 10 +++++----- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/dist/index.js b/dist/index.js index a111d33d..be8a4d1f 100644 --- a/dist/index.js +++ b/dist/index.js @@ -32064,7 +32064,7 @@ const setDynamicVars = () => { context.ACTOR = github.context.actor context.REF = github.context.ref context.SHA = github.context.sha - context.BRANCH = github.context.ref.substring(11) + context.BRANCH = github.context.ref.substring('refs/heads/'.length) } } @@ -32284,7 +32284,7 @@ const { SHA, USER, REPOSITORY, - REF, + BRANCH, TRIM_COMMIT_MESSAGE, BUILD_ENV, PREBUILT, @@ -32300,7 +32300,7 @@ const init = () => { let deploymentUrl const deploy = async (commit) => { - let commandArguments = [ `--token=${ VERCEL_TOKEN }` ] + let commandArguments = [ `--token=${ VERCEL_TOKEN }`, 'deploy' ] if (VERCEL_SCOPE) { commandArguments.push(`--scope=${ VERCEL_SCOPE }`) @@ -32326,7 +32326,7 @@ const init = () => { `githubCommitMessage=${ TRIM_COMMIT_MESSAGE ? commit.commitMessage.split(/\r?\n/)[0] : commit.commitMessage }`, `githubCommitOrg=${ USER }`, `githubCommitRepo=${ REPOSITORY }`, - `githubCommitRef=${ REF }`, + `githubCommitRef=${ BRANCH }`, `githubCommitSha=${ SHA }`, `githubOrg=${ USER }`, `githubRepo=${ REPOSITORY }`, @@ -32345,7 +32345,7 @@ const init = () => { } core.info('Starting deploy with Vercel ▲ CLI') - const output = await execCmd('vercel deploy', commandArguments, WORKING_DIRECTORY) + const output = await execCmd('vercel', commandArguments, WORKING_DIRECTORY) const match = output.match(/(?<=https:\/\/)(.*)/g) const parsed = match ? match[0] : null @@ -32363,7 +32363,7 @@ const init = () => { commandArguments.push(`--scope=${ VERCEL_SCOPE }`) } - return await execCmd('vercel deploy', commandArguments, WORKING_DIRECTORY) + return await execCmd('vercel', commandArguments, WORKING_DIRECTORY) } const getDeployment = async () => { diff --git a/src/config.js b/src/config.js index 4c2efb1c..311f052b 100644 --- a/src/config.js +++ b/src/config.js @@ -63,7 +63,7 @@ const setDynamicVars = () => { context.ACTOR = github.context.actor context.REF = github.context.ref context.SHA = github.context.sha - context.BRANCH = github.context.ref.substring(11) + context.BRANCH = github.context.ref.substring('refs/heads/'.length) } } diff --git a/src/vercel.js b/src/vercel.js index 2fbab4e4..c13ec0c3 100644 --- a/src/vercel.js +++ b/src/vercel.js @@ -10,7 +10,7 @@ const { SHA, USER, REPOSITORY, - REF, + BRANCH, TRIM_COMMIT_MESSAGE, BUILD_ENV, PREBUILT, @@ -26,7 +26,7 @@ const init = () => { let deploymentUrl const deploy = async (commit) => { - let commandArguments = [ `--token=${ VERCEL_TOKEN }` ] + let commandArguments = [ `--token=${ VERCEL_TOKEN }`, 'deploy' ] if (VERCEL_SCOPE) { commandArguments.push(`--scope=${ VERCEL_SCOPE }`) @@ -52,7 +52,7 @@ const init = () => { `githubCommitMessage=${ TRIM_COMMIT_MESSAGE ? commit.commitMessage.split(/\r?\n/)[0] : commit.commitMessage }`, `githubCommitOrg=${ USER }`, `githubCommitRepo=${ REPOSITORY }`, - `githubCommitRef=${ REF }`, + `githubCommitRef=${ BRANCH }`, `githubCommitSha=${ SHA }`, `githubOrg=${ USER }`, `githubRepo=${ REPOSITORY }`, @@ -71,7 +71,7 @@ const init = () => { } core.info('Starting deploy with Vercel ▲ CLI') - const output = await execCmd('vercel deploy', commandArguments, WORKING_DIRECTORY) + const output = await execCmd('vercel', commandArguments, WORKING_DIRECTORY) const match = output.match(/(?<=https:\/\/)(.*)/g) const parsed = match ? match[0] : null @@ -89,7 +89,7 @@ const init = () => { commandArguments.push(`--scope=${ VERCEL_SCOPE }`) } - return await execCmd('vercel deploy', commandArguments, WORKING_DIRECTORY) + return await execCmd('vercel', commandArguments, WORKING_DIRECTORY) } const getDeployment = async () => {