This commit is contained in:
phips28 2022-06-28 14:02:27 +02:00
parent 777b27d79f
commit 04a4ee12d8
1 changed files with 3 additions and 2 deletions

View File

@ -142,13 +142,14 @@ const workspace = process.env.GITHUB_WORKSPACE;
`"${process.env.GITHUB_EMAIL || 'gh-action-bump-version@users.noreply.github.com'}"`,
]);
const refsRegExResult = /refs\/[a-zA-Z]+\/(.*)/.exec(process.env.GITHUB_REF);
let currentBranch = refsRegExResult ? refsRegExResult[1] : undefined;
let currentBranch;
let isPullRequest = false;
if (process.env.GITHUB_HEAD_REF) {
// Comes from a pull request
currentBranch = process.env.GITHUB_HEAD_REF;
isPullRequest = true;
} else {
currentBranch = /refs\/[a-zA-Z]+\/(.*)/.exec(process.env.GITHUB_REF)[1];
}
if (process.env['INPUT_TARGET-BRANCH']) {
// We want to override the branch that we are pulling / pushing to