fix: push main before generating release notes#49
Merged
Conversation
The generate-notes GitHub API walks commits on the remote, so it silently omits any merges that have not been pushed yet. Cutting 0.4.0 produced an empty changelog entry and an empty GitHub Release body for this reason — release.sh merged develop into main locally, then called the API before pushing. From the API's perspective there were no commits between 0.3.1 and remote main. Push main first, then generate, then commit the changelog and push the tag. main now gets pushed twice per release (once with the merge, once with the changelog commit), which is the cost of keeping CHANGELOG.md and the GitHub Release body identical. Also restores the 0.4.0 entry in CHANGELOG.md to match the GitHub Release body for that tag (manually patched after the failed run). Co-Authored-By: Claude Opus 4.7 (1M context) <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.
Summary
Cutting
0.4.0exposed a timing bug inbin/release.sh. The script was calling GitHub'sreleases/generate-notesAPI before pushingmain, so the API saw no commits between0.3.1and remotemainand returned an empty body. Both theCHANGELOG.mdentry and the GitHub Release body for0.4.0came back blank.Fix: push
mainto the remote first, then call the API, then commit the changelog, then pushmainagain with the tag.mainnow gets pushed twice per release (once with the develop merge, once with the changelog commit) — that's the cost of keepingCHANGELOG.mdand the GitHub Release body identical.Also restores the
0.4.0entry inCHANGELOG.mdto match the GitHub Release body, which was hand-patched after the failed run.Test plan
bash -n bin/release.shsyntax clean0.4.1) — first real run of the corrected flowSide note
While recovering
0.4.0we noticedgh api releases/generate-notessilently omitted PR #42 because GitHub's storedmergeCommitShafor that PR didn't match the actual commit onmain. That's a pre-existing GitHub-side quirk, not something this PR addresses — release.sh has no signal to detect it. Worth spot-checking the generated notes againstgit log --first-parent --mergesafter each future release until we know how often it happens.🤖 Generated with Claude Code