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'}"`,
|
`"${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;
|
||||||
let currentBranch = refsRegExResult ? refsRegExResult[1] : undefined;
|
|
||||||
let isPullRequest = false;
|
let isPullRequest = false;
|
||||||
if (process.env.GITHUB_HEAD_REF) {
|
if (process.env.GITHUB_HEAD_REF) {
|
||||||
// Comes from a pull request
|
// Comes from a pull request
|
||||||
currentBranch = process.env.GITHUB_HEAD_REF;
|
currentBranch = process.env.GITHUB_HEAD_REF;
|
||||||
isPullRequest = true;
|
isPullRequest = true;
|
||||||
|
} else {
|
||||||
|
currentBranch = /refs\/[a-zA-Z]+\/(.*)/.exec(process.env.GITHUB_REF)[1];
|
||||||
}
|
}
|
||||||
if (process.env['INPUT_TARGET-BRANCH']) {
|
if (process.env['INPUT_TARGET-BRANCH']) {
|
||||||
// We want to override the branch that we are pulling / pushing to
|
// We want to override the branch that we are pulling / pushing to
|
||||||
|
|
Loading…
Reference in New Issue