Skip to content

Commit 24344df

Browse files
authored
fix(success): fix access to the release notes (#284)
There was a wrong assumption that release notes would be passed separately to the plugin. This is not the case and could break clients using the new addRelease feature. This commit fixes the access to the release notes of the next release.
1 parent db2e9c8 commit 24344df

File tree

3 files changed

+4
-6
lines changed

3 files changed

+4
-6
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,8 @@ If you have actions that trigger on newly created releases, please use a generat
8383
| `failTitle` | The title of the issue created when a release fails. Set to `false` to disable opening an issue when a release fails. | `The automated release is failing 🚨` |
8484
| `labels` | The [labels](https://help.github.com/articles/about-labels) to add to the issue created when a release fails. Set to `false` to not add any label. | `['semantic-release']` |
8585
| `assignees` | The [assignees](https://help.github.com/articles/assigning-issues-and-pull-requests-to-other-github-users) to add to the issue created when a release fails. | - |
86-
| `releasedLabels` | The [labels](https://help.github.com/articles/about-labels) to add to each issue and pull request resolved by the release. Set to `false` to not add any label. See [releasedLabels](#releasedlabels). | `['released<%= nextRelease.channel ? \` on @\${nextRelease.channel}\` : "" %>']` |
86+
| `releasedLabels` | The [labels](https://help.github.com/articles/about-labels) to add to each issue and pull request resolved by the release. Set to `false` to not add any label. See [releasedLabels](#releasedlabels). | `['released<%= nextRelease.channel ? \` on @\${nextRelease.channel}\` : "" %>']- |
87+
| `addReleases` | Will add release links to the GitHub Release. Can be `false`, `"bottom"` or `"top"`. See [addReleases](#addReleases). | `false` |
8788

8889
#### proxy
8990

lib/success.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ module.exports = async (pluginConfig, context) => {
1919
nextRelease,
2020
releases,
2121
logger,
22-
notes,
2322
} = context;
2423
const {
2524
githubToken,
@@ -152,8 +151,8 @@ module.exports = async (pluginConfig, context) => {
152151
if (!isEmpty(additionalReleases) && !isNil(ghRelaseId)) {
153152
const newBody =
154153
addReleases === 'top'
155-
? additionalReleases.concat('\n---\n', notes)
156-
: notes.concat('\n---\n', additionalReleases);
154+
? additionalReleases.concat('\n---\n', nextRelease.notes)
155+
: nextRelease.notes.concat('\n---\n', additionalReleases);
157156
await github.repos.updateRelease({owner, repo, release_id: ghRelaseId, body: newBody});
158157
}
159158
}

test/success.test.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -675,7 +675,6 @@ test.serial('Editing the release to include all release links at the bottom', as
675675
commits,
676676
nextRelease,
677677
releases,
678-
notes: nextRelease.notes,
679678
logger: t.context.logger,
680679
});
681680

@@ -733,7 +732,6 @@ test.serial('Editing the release to include all release links at the top', async
733732
commits,
734733
nextRelease,
735734
releases,
736-
notes: nextRelease.notes,
737735
logger: t.context.logger,
738736
});
739737

0 commit comments

Comments
 (0)