Fix version-bump PR being silently discarded by create-pull-request action#3522
Merged
Conversation
…ction peter-evans/create-pull-request@v7 force-resets any branch it's handed that already matches base with no further diff, which is exactly what step 2 (manual commit+push to version-bump/<tag>) produced. Let create-pull-request do its normal job (discover the AssemblyInfo.cs diff, commit, push, open PR) and tag the resulting pull-request-head-sha afterward instead. Cannot be verified by tests or a local run (workflow_dispatch only); confirmed correct on the next real release run.
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.
Root cause
In the
release_kind == 'release'path of.github/workflows/build-and-release.yml, the workflow used to:Gum/Properties/AssemblyInfo.csto today's date ("Update AssemblyInfo.cs version" — unchanged by this PR, still runs unconditionally and its edit is correctly baked into the shipped binary by the build step that follows it).version-bump/<tag>, commit theAssemblyInfo.csedit directly onto it, create the annotated tag on that commit, then push both the branch and the tag.peter-evans/create-pull-request@v7withbranch: version-bump/<tag>— the same branch name step 2 had just pushed.Because step 3's
branch:input already existed onorigin(pushed by step 2) with no further working-tree diff,peter-evans/create-pull-request@v7treated it as an already-in-sync PR branch and force-reset it back tomain's commit, discarding the version-bump commit. Confirmed in the logs of run 28795611132:followed by a force-push and
pull-request-operation = none.The commit itself wasn't lost — the tag, pushed separately and earlier in step 2, still points at it — but no PR was ever created. This has been silently happening on every release since at least February:
main's ownGum/Properties/AssemblyInfo.csis still pinned at2026.05.02, several releases stale, because there's never been a PR to review/merge the bump.The fix
Swap the order: let
peter-evans/create-pull-request@v7do the committing itself (its normal, well-supported usage — discover the uncommittedAssemblyInfo.csdiff, commit it, push a fresh branch, open the PR), and create the git tag after, pointing at the commit SHA the action reports via itspull-request-head-shaoutput — instead of manually committing to the exact branch name handed to that action (which is what triggered its "already matches base" force-reset).Replaced the two steps "Commit version bump, create tag, push branch+tag" and "Create pull request for version bump" with, in order:
id: version_bump_pr) — unchanged inputs otherwise, just moved earlier and given an id.steps.version_bump_pr.outputs.pull-request-head-shaand pushes that tag.No other steps in the file were touched. "Compute tag + title" (produces
steps.meta.outputs.tag/title, consumed by both) and "Capture previous release tag" stay where they are; "Create GitHub Release" stays last and is unaffected — by the time it runs the tag already exists, same as before.Verification
This can't be exercised by unit tests or a local run — it's a
workflow_dispatch-only workflow, no product code changed.Done instead:
js-yaml, all 16 steps in expected order).pull-request-head-shais a real output ofpeter-evans/create-pull-request@v7(checked the action'saction.ymldirectly) — this is the exact key already seen (as a genuine log excerpt, not a guess) in a prior real run.Manual test: needed, but deferred to the next real
release_kind: releaserun — the only way to confirm this end-to-end is to actually run "Build and Release Gum Tool" withrelease_kind: releaseand check that a PR titled "Bump version to Release_" appears (previously it silently didn't), and that the tag is created no differently than before.