fix: verify branch first

This commit is contained in:
Pierre Vanduynslager
2018-02-15 18:35:37 +00:00
committed by Gregor Martynus
parent 305f4ee8eb
commit 1966f0e3e2
4 changed files with 24 additions and 40 deletions
+1 -12
View File
@@ -3,7 +3,7 @@ const AggregateError = require('aggregate-error');
const {isGitRepo, verifyAuth, verifyTagName} = require('./git');
const getError = require('./get-error');
module.exports = async (options, branch, logger) => {
module.exports = async options => {
const errors = [];
if (!await isGitRepo()) {
@@ -29,15 +29,4 @@ module.exports = async (options, branch, logger) => {
if (errors.length > 0) {
throw new AggregateError(errors);
}
if (branch !== options.branch) {
logger.log(
`This test run was triggered on the branch ${branch}, while semantic-release is configured to only publish from ${
options.branch
}, therefore a new version wont be published.`
);
return false;
}
return true;
};