fix #30
This commit is contained in:
parent
777b27d79f
commit
04a4ee12d8
5
index.js
5
index.js
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue