feat(#759): non-destructive CHANGELOG preview in the rc release job (#763)

The rc action publishes a release candidate to @next for testing but
never surfaces the curated CHANGELOG section for the version under test —
render only runs destructively at finalize (#715), so there was no safe
way to preview the upcoming notes during the RC window.

Add a --preview mode to scripts/changeset/cli.cjs cmdRender: it renders
the dated release section to stdout via the existing renderChangelog/
serializeChangelog path (with priorChangelog: null, so only the new
section is emitted), reuses the shared injectEmptyPlaceholder helper for
zero-fragment releases, and returns WITHOUT writing CHANGELOG.md or
deleting any .changeset fragment. Wire a "Preview CHANGELOG" step into
the rc job that renders to a file (standalone command, so a malformed
fragment fails the step) and cats it to the job summary and log.

Closes #759

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Tom Boucher
2026-06-07 10:05:21 -04:00
committed by GitHub
parent 3011b937ad
commit 5237fae537
4 changed files with 187 additions and 11 deletions

View File

@@ -167,6 +167,7 @@ When `next` has accumulated enough work to ship a new minor/major.
- Each fix should also be PR'd to `next` so the next release has it too
(or wait for the auto-back-merge after finalize)
- Trigger `rc` action to publish RC builds: 1.28.0-rc.1, rc.2, ...
- Each `rc` run also prints a non-destructive preview of the curated `## [X.Y.0]` CHANGELOG section in the Actions job summary — rendered from the `.changeset/` fragments without consuming them — so you can review the upcoming release notes during RC testing.
4. When stable: trigger `finalize`.
- Publishes to npm @latest