From bc9a128c37883b29b93562087bbbe4fd1db7cb72 Mon Sep 17 00:00:00 2001 From: Joachim Westphal Date: Fri, 26 Aug 2022 13:23:23 +0200 Subject: [PATCH 1/2] Send branch name instead of ref to Vercel --- dist/index.js | 6 +++--- src/config.js | 2 +- src/vercel.js | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/dist/index.js b/dist/index.js index b5f81e25..b0cb76a0 100644 --- a/dist/index.js +++ b/dist/index.js @@ -16001,7 +16001,7 @@ const setDynamicVars = () => { context.ACTOR = github.context.actor context.REF = github.context.ref context.SHA = github.context.sha - context.BRANCH = github.context.ref.substr(11) + context.BRANCH = github.context.ref.substring(11) } } @@ -16224,7 +16224,7 @@ const { SHA, USER, REPOSITORY, - REF, + BRANCH, TRIM_COMMIT_MESSAGE, BUILD_ENV, WORKING_DIRECTORY, @@ -16260,7 +16260,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 }`, diff --git a/src/config.js b/src/config.js index accfb047..bc7e1ebd 100644 --- a/src/config.js +++ b/src/config.js @@ -130,7 +130,7 @@ const setDynamicVars = () => { context.ACTOR = github.context.actor context.REF = github.context.ref context.SHA = github.context.sha - context.BRANCH = github.context.ref.substr(11) + context.BRANCH = github.context.ref.substring(11) } } diff --git a/src/vercel.js b/src/vercel.js index 8ed11680..45d6ea3c 100644 --- a/src/vercel.js +++ b/src/vercel.js @@ -11,7 +11,7 @@ const { SHA, USER, REPOSITORY, - REF, + BRANCH, TRIM_COMMIT_MESSAGE, BUILD_ENV, WORKING_DIRECTORY, @@ -47,7 +47,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 }`, From cc5d798b04cef9e619397ef3eb89e2409bbbe788 Mon Sep 17 00:00:00 2001 From: Joachim Westphal Date: Mon, 13 May 2024 18:27:43 +0200 Subject: [PATCH 2/2] made explicit why we remove the 11 first characters from the branch ref --- dist/index.js | 2 +- src/config.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dist/index.js b/dist/index.js index 8d4f6a3f..d5e02606 100644 --- a/dist/index.js +++ b/dist/index.js @@ -16022,7 +16022,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/config.js b/src/config.js index 23480571..9e6985b1 100644 --- a/src/config.js +++ b/src/config.js @@ -136,7 +136,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) } }