diff --git a/index.js b/index.js index 4d5aaedc73..08c42b5902 100644 --- a/index.js +++ b/index.js @@ -27,7 +27,7 @@ marked.setOptions({renderer: new TerminalRenderer()}); async function run(context, plugins) { const {cwd, env, options, logger} = context; const {isCi, branch, prBranch, isPr} = context.envCi; - const ciBranch = isPr ? prBranch : branch; + const ciBranch = isPr && !options.noCi ? prBranch : branch; if (!isCi && !options.dryRun && !options.noCi) { logger.warn('This run was not triggered in a known CI environment, running in dry-run mode.'); diff --git a/test/index.test.js b/test/index.test.js index d2533c4919..74fee8ee96 100644 --- a/test/index.test.js +++ b/test/index.test.js @@ -1258,7 +1258,7 @@ test('Allow local releases with "noCi" option', async (t) => { const semanticRelease = requireNoCache('..', { './lib/get-logger': () => t.context.logger, - 'env-ci': () => ({isCi: false, branch: 'master', isPr: false}), + 'env-ci': () => ({isCi: false, branch: 'master', isPr: true, prBranch: 'refs/pull/4/merge'}), }); t.truthy( await semanticRelease(options, {