fix: fix the --no-ci arg parsing

The `noCi` is no properly set based on the `--no-ci` CLI arg and it is overwritten by the `noCi` option
This commit is contained in:
Pierre Vanduynslager
2018-01-24 22:22:16 -08:00
committed by Gregor Martynus
parent 7e860c7915
commit 0d2d1f2376
4 changed files with 83 additions and 10 deletions
+5 -6
View File
@@ -9,13 +9,15 @@ const {gitHead: getGitHead, isGitRepo} = require('./lib/git');
module.exports = async opts => {
const {isCi, branch, isPr} = envCi();
const config = await getConfig(opts, logger);
const {plugins, options} = config;
if (!isCi && !opts.dryRun && !opts.noCi) {
if (!isCi && !options.dryRun && !options.noCi) {
logger.log('This run was not triggered in a known CI environment, running in dry-run mode.');
opts.dryRun = true;
options.dryRun = true;
}
if (isCi && isPr && !opts.noCi) {
if (isCi && isPr && !options.noCi) {
logger.log("This run was triggered by a pull request and therefore a new version won't be published.");
return;
}
@@ -25,9 +27,6 @@ module.exports = async opts => {
return;
}
const config = await getConfig(opts, logger);
const {plugins, options} = config;
if (branch !== options.branch) {
logger.log(
`This test run was triggered on the branch ${branch}, while semantic-release is configured to only publish from ${