Skip to content

Commit 5b90cd4

Browse files
committed
fix(get-latest-release): allow using GIT_LOCAL_BRANCH on GH Actions
1 parent 450efd0 commit 5b90cd4

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

getLastRelease.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,12 @@ module.exports = function (pluginConfig, config, cb) {
77

88
if (config.env.TRAVIS) {
99
branch = config.env.TRAVIS_BRANCH;
10+
} else if (config.env.GIT_LOCAL_BRANCH) {
11+
branch = config.env.GIT_LOCAL_BRANCH;
1012
} else if (config.env.GITHUB_REF) {
1113
branch = utils.ghActionsBranch(config.env);
1214
} else {
13-
branch = config.env.GIT_LOCAL_BRANCH;
15+
throw new Error('Unable to determine Git branch. Tried TRAVIS_BRANCH, GIT_LOCAL_BRANCH and GITHUB_REF');
1416
}
1517

1618
const distTag = config.options.branchTags[branch];

0 commit comments

Comments
 (0)