Repository navigation
fix(release): create the draft release in one step - #130
Merged
Merged
Conversation
Three jobs wrote the release through softprops/action-gh-release, which finds its draft by tag. On v1.3.1 the description job's lookup missed: it created a second draft holding the description, then removed "the duplicate" (the new one), leaving the release with both installers and an empty body. The build jobs now only upload workflow artifacts (and drop to contents: read). A single `release` job downloads both and runs one `gh release create --draft --verify-tag` with the files, the description and GitHub's generated notes. It refuses to run if a release for the tag already exists, since GitHub allows any number of drafts per tag and a re-run would otherwise leave two. Co-Authored-By: Claude Opus 5.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 bug
The v1.3.1 draft came out of
release.ymlwith both installers attached but an empty description. The workflow had three writers, allsoftprops/action-gh-releasewithdraft: true: each build job attached its own file, andrelease-noteswrote the body. The action finds a draft by looking it up by tag, and GitHub's get-release-by-tag endpoint doesn't return drafts. On v1.3.1 the description job's lookup missed. From its log:It wrote the description to a new draft, then deleted that draft as "the duplicate" and kept the older one, which had the installers but no text. (v1.3.1's notes were added by hand afterwards.)
Fix
One writer.
windows-installerandlinux-bundlesno longer touch the release. They already upload their installers as workflow artifacts, so their attach steps are gone and their permissions drop tocontents: read.release(renamed fromrelease-notes, still tag-only and run after both builds) downloads both artifacts and runs a singlegh release create "$TAG" installers/* --draft --verify-tag --title "$TAG" --notes-file … --generate-notes. Files, description and GitHub's generated PR summary all land in one call.--verify-tagstops it inventing a tag.body:(2,800 bytes, checked by running the step locally).docs/architecture/packaging.mddescribes the new shape and why.Verified
bash -n.v1.3.1, finds nothing for an unused tag.gh release createdocs confirm--notes-filetext goes above the--generate-notessummary, assoftpropsdid before.Not verified
v*tag push, and there's no way to dry-run that without creating a tag and a draft. The next real release (v1.3.2 or later) is the first live run.releasejob alone; there's no need to rebuild.🤖 Generated with Claude Code