Skip to content

Commit

Permalink
fix: correctly handle skipped releases
Browse files Browse the repository at this point in the history
  • Loading branch information
pvdlg committed Dec 16, 2018
1 parent 70c68ef commit 1243f79
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 3 additions & 3 deletions lib/definitions/plugins.js
Expand Up @@ -71,9 +71,9 @@ module.exports = {
pipelineConfig: () => ({
// Add `nextRelease` and plugin properties to published release
transform: (release, step, {nextRelease}) => ({
...(isPlainObject(release) ? release : {}),
...nextRelease,
...(release === false ? {} : step),
...(release === false ? {} : nextRelease),
...release,
...step,
}),
}),
},
Expand Down
6 changes: 5 additions & 1 deletion test/index.test.js
Expand Up @@ -712,6 +712,7 @@ test('Accept "undefined" value returned by "generateNotes" and "false" by "publi
const notes2 = 'Release notes 2';
const generateNotes2 = stub().resolves(notes2);
const publish = stub().resolves(false);
const success = stub().resolves();

const options = {
branch: 'master',
Expand All @@ -722,7 +723,7 @@ test('Accept "undefined" value returned by "generateNotes" and "false" by "publi
generateNotes: [generateNotes1, generateNotes2],
prepare: stub().resolves(),
publish,
success: stub().resolves(),
success,
fail: stub().resolves(),
};

Expand Down Expand Up @@ -754,6 +755,9 @@ test('Accept "undefined" value returned by "generateNotes" and "false" by "publi
t.is(publish.callCount, 1);
t.deepEqual(publish.args[0][1].lastRelease, lastRelease);
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 => {
Expand Down

0 comments on commit 1243f79

Please sign in to comment.