ci: take the release notes from the CHANGELOG - #502
Merged
Merged
Conversation
The 1.0.0 release notes were whatever --generate-notes produced: a list of merged pull requests. Four of the twelve were CI plumbing for the release mechanism itself, so a consumer opening the release read "stop setup-node's .npmrc breaking every yarn step" next to the reason the library got faster, and nothing about the rewrite, the dependency that went away or how to upgrade. Meanwhile the CHANGELOG said all of it. The workflow now builds the notes from the CHANGELOG entry for the version being released, and appends a compare link against the previous release. The v1.0.0 release has already been corrected by hand with exactly what this produces — verified by diffing the two, which match apart from a trailing newline GitHub adds. scripts/changelog-section.mjs extracts one section, dropping the heading since the release carries the version as its title. It exits non-zero when the section is missing or empty, which makes it a release guard as well: a version nobody wrote an entry for is not ready to publish, and that now fails in seconds alongside the other cheap checks rather than after the gate. A rehearsal renders the notes it would publish into the run summary, so the wording can be read before it is public rather than edited afterwards, which is what happened here. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The v1.0.0 release notes were whatever
--generate-notesproduced: a list of merged pull requests. Four of the twelve were CI plumbing for the release mechanism itself, so a consumer opening the release readnext to the reason the library got faster — and nothing about the rewrite, the dependency that went away, or how to upgrade. Meanwhile the CHANGELOG said all of it.
The live v1.0.0 release is already fixed. This makes sure the next one does not need fixing.
The workflow now builds notes from the CHANGELOG
scripts/changelog-section.mjsextracts one version's section, dropping the heading since the release already carries the version as its title, and the workflow appends a compare link against the previous release.Verified by diffing what the script produces against what is now live on v1.0.0: identical apart from a trailing newline GitHub adds.
It doubles as a release guard
The script exits non-zero when the section is missing or empty:
A version nobody wrote an entry for is not ready to publish. That now fails in seconds alongside the other cheap guards rather than after the full gate — and it means the release and the CHANGELOG cannot drift apart, because the release is the CHANGELOG.
NPM_TOKENemptyRehearsals now show the notes
A dry run renders the notes it would publish into the run summary, inside a
<details>block. The wording can be read before it is public rather than edited afterwards — which is exactly what happened here.Worth knowing
--generate-notesis gone entirely, so the PR list no longer appears. If you want it back for a future release it belongs in the CHANGELOG entry, where you control which entries are worth a reader's time.🤖 Generated with Claude Code