Skip to content

ci: take the release notes from the CHANGELOG - #502

Merged
fjmorant merged 1 commit into
masterfrom
ci/changelog-release-notes
Sep 26, 2026
Merged

fjmorant merged 1 commit into
masterfrom
ci/changelog-release-notes

Conversation

@fjmorant

Copy link
Copy Markdown
Owner

The v1.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 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.mjs extracts 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:

$ node scripts/changelog-section.mjs 1.1.0
changelog-section: no "## 1.1.0" in CHANGELOG.md
  exit=1

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.

guard when it fires
tag already exists before the gate
version already on npm before the gate
no CHANGELOG entry before the gate ← new
NPM_TOKEN empty before the gate

Rehearsals 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-notes is 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

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>
@fjmorant
fjmorant merged commit 68df19f into master Sep 26, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant