fix: correctly handle skipped releases

This commit is contained in:
Pierre Vanduynslager 2018-12-16 16:17:04 -05:00
parent 70c68ef3ed
commit 1243f79064
2 changed files with 8 additions and 4 deletions

View File

@ -71,9 +71,9 @@ module.exports = {
pipelineConfig: () => ({ pipelineConfig: () => ({
// Add `nextRelease` and plugin properties to published release // Add `nextRelease` and plugin properties to published release
transform: (release, step, {nextRelease}) => ({ transform: (release, step, {nextRelease}) => ({
...(isPlainObject(release) ? release : {}), ...(release === false ? {} : nextRelease),
...nextRelease, ...release,
...(release === false ? {} : step), ...step,
}), }),
}), }),
}, },

View File

@ -712,6 +712,7 @@ test('Accept "undefined" value returned by "generateNotes" and "false" by "publi
const notes2 = 'Release notes 2'; const notes2 = 'Release notes 2';
const generateNotes2 = stub().resolves(notes2); const generateNotes2 = stub().resolves(notes2);
const publish = stub().resolves(false); const publish = stub().resolves(false);
const success = stub().resolves();
const options = { const options = {
branch: 'master', branch: 'master',
@ -722,7 +723,7 @@ test('Accept "undefined" value returned by "generateNotes" and "false" by "publi
generateNotes: [generateNotes1, generateNotes2], generateNotes: [generateNotes1, generateNotes2],
prepare: stub().resolves(), prepare: stub().resolves(),
publish, publish,
success: stub().resolves(), success,
fail: stub().resolves(), fail: stub().resolves(),
}; };
@ -754,6 +755,9 @@ test('Accept "undefined" value returned by "generateNotes" and "false" by "publi
t.is(publish.callCount, 1); t.is(publish.callCount, 1);
t.deepEqual(publish.args[0][1].lastRelease, lastRelease); t.deepEqual(publish.args[0][1].lastRelease, lastRelease);
t.is(publish.args[0][1].nextRelease.notes, notes2); t.is(publish.args[0][1].nextRelease.notes, notes2);
t.is(success.callCount, 1);
t.deepEqual(success.args[0][1].releases, [{pluginName: '[Function: proxy]'}]);
}); });
test('Returns false if triggered by a PR', async t => { test('Returns false if triggered by a PR', async t => {