fix(release): populate changelog and server-changes on release/dispatch#4204
Merged
Conversation
The "What's changed" section was built solely from github.event.pull_request.body, which is only present on the pull_request merge event. On a workflow_dispatch re-run that context is empty, so the GitHub release published with an empty changelog and failed silently. Resolve RELEASE_PR_BODY robustly: fall back to the body of the most recently merged changeset-release/main PR when the pull_request context is absent. Also fail loudly in generate-github-release.mjs when a non-prerelease resolves no changelog content, so an empty changelog can no longer publish silently. Prereleases remain exempt. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014CjQVhMqLbRo3VuLaGSLfg
|
Read .server-changes from git when the working tree copy has already been cleaned up, and log recovery failures instead of swallowing them. Folds in the fix from #4209. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014CjQVhMqLbRo3VuLaGSLfg
…er/or Combine working-tree and git-recovered server-change files (dedup by filename) so a partial cleanup can't drop entries from the release notes.
ericallam
approved these changes
Jul 9, 2026
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.
Requested by Chris Arderne · Slack thread
This PR fixes two related release-pipeline bugs. It also supersedes #4209, whose server-changes fix is folded in here.
Before:
workflow_dispatch(the recovery path after a merge-triggered run fails) produced a GitHub release with no "What's changed" section — the changelog came out empty and publishing still succeeded, so it failed silently..server-changes/*.mdentries were dropped from the release PR body and the release notes: the working-tree.server-changes/directory is emptied bycleanup-server-changes.mjsbeforeenhance-release-pr.mjsreads it, so the## Server changessection never appeared.After:
workflow_dispatchpath the changelog is resolved from the mergedchangeset-release/mainPR, and a stable (non-prerelease) release now fails loudly instead of publishing an empty changelog..server-changesentries from git, so the## Server changessection is populated in both the release PR body and the published GitHub release.How:
github.event.pull_request.body, which is only populated on thepull_request: [closed]event. On aworkflow_dispatchrun there is no pull_request context, so it was empty..github/workflows/release.yml("Create unified GitHub release" step): whenRELEASE_PR_BODYis empty (the dispatch path), fall back to the body of the most recently mergedchangeset-release/mainPR viagh pr list(using the step's existingGH_TOKEN). Thepull_requestmerge path is unchanged.scripts/generate-github-release.mjs: after extracting the changelog, exit non-zero with a clear error when a non-prerelease resolves no "What's changed" content, so an empty changelog can't publish silently again. Prereleases (any version with a hyphen) remain exempt.scripts/enhance-release-pr.mjs: when the working-tree.server-changes/directory has already been cleaned up, recover the deleted entries from git —merge-basethe base and release refs, list files deleted under.server-changeswithgit diff --diff-filter=D, and read each one back withgit show <mergeBase>:<path>. Recovery failures are now logged instead of being silently swallowed.✅ Checklist
Testing
Ran
node --check scripts/generate-github-release.mjsandnode --check scripts/enhance-release-pr.mjs(both parse clean) and exercised the changelog script directly:RELEASE_PR_BODYfor a stable version renders the "## What's changed" section as before.RELEASE_PR_BODYfor a stable version (e.g.4.5.2) exits 1 with a clear error and writes no release body.RELEASE_PR_BODYfor a prerelease (e.g.4.5.0-rc.0) exits 0 and omits the section (unchanged, expected).Changelog
Resolve the release changelog from the merged
changeset-release/mainPR onworkflow_dispatchreruns, fail the release loudly when a non-prerelease resolves an empty changelog, and recover.server-changesentries from git so the server-changes section is populated even after the working-tree directory has been cleaned up.Generated by Claude Code