Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: replaced the ref sent to Vercel set in githubCommitRef by the branch name #232

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe one could even be more explicit and state where the 11 char length comes from?

Suggested change
context.BRANCH = github.context.ref.substring(11)
context.BRANCH = github.context.ref.substring("refs/heads/".length)

}
}

Expand Down Expand Up @@ -16224,7 +16224,7 @@ const {
SHA,
USER,
REPOSITORY,
REF,
BRANCH,
TRIM_COMMIT_MESSAGE,
BUILD_ENV,
WORKING_DIRECTORY,
Expand Down Expand Up @@ -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 }`,
Expand Down
2 changes: 1 addition & 1 deletion src/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}

Expand Down
4 changes: 2 additions & 2 deletions src/vercel.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const {
SHA,
USER,
REPOSITORY,
REF,
BRANCH,
TRIM_COMMIT_MESSAGE,
BUILD_ENV,
WORKING_DIRECTORY,
Expand Down Expand Up @@ -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 }`,
Expand Down