Merge pull request #215 from mmatotan/master
Optionally select the second element from array
This commit is contained in:
commit
731aed4287
4
index.js
4
index.js
|
@ -179,7 +179,9 @@ const pkg = getPackageJson();
|
|||
currentBranch = process.env.GITHUB_HEAD_REF;
|
||||
isPullRequest = true;
|
||||
} else {
|
||||
currentBranch = /refs\/[a-zA-Z]+\/(.*)/.exec(process.env.GITHUB_REF)[1];
|
||||
let regexBranch = /refs\/[a-zA-Z]+\/(.*)/.exec(process.env.GITHUB_REF);
|
||||
// If GITHUB_REF is null then do not set the currentBranch
|
||||
currentBranch = regexBranch ? regexBranch[1] : undefined;
|
||||
}
|
||||
if (process.env['INPUT_TARGET-BRANCH']) {
|
||||
// We want to override the branch that we are pulling / pushing to
|
||||
|
|
Loading…
Reference in New Issue