Skip to content

Commit

Permalink
fix: expose branch when --release-pr flag is active
Browse files Browse the repository at this point in the history
fixes an issue where semantic release could not get branch info
since prBranch of env-ci was set to undefined
  • Loading branch information
Xiphe committed Mar 2, 2020
1 parent 3975f06 commit cc2afd1
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions src/semantishPrerelease.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,19 @@ module.exports = async function semantishPrerelease(
return proxyquire('semantic-release', {
'./lib/get-next-version': getNextVersion,
'./lib/git': git,
'env-ci': (subContext) => ({
...getEnvCi(subContext),
...(options.releasePr
? { isPr: false, pr: undefined, prBranch: undefined }
: {}),
}),
'env-ci': (subContext) => {
const envCi = getEnvCi(subContext);
if (!options.releasePr || !envCi.pr) {
return envCi;
}

return {
...envCi,
isPr: false,
pr: undefined,
prBranch: undefined,
branch: envCi.branch || envCi.prBranch,
};
},
})(await getOptions(options, context), context);
};

0 comments on commit cc2afd1

Please sign in to comment.