fix(ci): merge Dependabot PRs directly instead of via --auto - #104
Merged
Conversation
The merge step failed for most Dependabot PRs: GraphQL: Auto merge is not allowed for this repository (enablePullRequestAutoMerge) GitHub's auto-merge feature is disabled on this repo (allow_auto_merge=false), so `gh pr merge --auto` only ever worked by accident: when a PR happened to be fully green and mergeable at that moment, gh merged it directly, and otherwise the call errored. That is exactly the observed mix of success and failure runs, and why #82-#95 piled up unmerged with autoMerge=no. Enabling the repo setting is the other possible fix, and it is the worse one. There is no branch protection here, so there are no REQUIRED status checks -- repo-wide auto-merge would merge any PR the moment it became mergeable, regardless of whether CI had run. That is a footgun well beyond Dependabot. We do not need it. The two wait-for-check gates above already block until "Run go test" and "Run golangci-lint" report success, and the step's `if` requires both. By the time we reach the merge, the checks have demonstrably passed, so a direct merge is equivalent in safety -- and it fails loudly on conflict rather than queueing silently forever. Combined with GH_PAT from ab21bd1, the full path now works: bump merged as a real user -> Test/Lint/Release Please fire on main -> `fix(deps)` cuts a patch release. Verified that ab21bd1 (merged manually as a user) triggered Lint, Test and Release Please, while 37f1d0f (auto-merged under the old token) triggered none.
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.
Follow-up to #99. That fixed attribution; this fixes the merge actually succeeding.
The error
GitHub's auto-merge feature is disabled on this repo, so
gh pr merge --autoonly ever worked by accident — when a PR happened to be fully green and mergeable at that instant,ghmerged it directly; otherwise the call errored. That's precisely the observed mix ofsuccessandfailureruns, and why #82–#95 piled up withautoMerge=no.Why not just enable the repo setting
Because there's no branch protection, so there are no required status checks. Repo-wide auto-merge would merge any PR the moment it became mergeable, whether or not CI had run — a footgun well beyond Dependabot.
We don't need it. The two
wait-for-checkgates already block untilRun go testandRun golangci-lintreport success, and the merge step'sifrequires both conclusions to besuccess. By the time execution reaches the merge, checks have demonstrably passed. A direct merge is equivalent in safety, and it fails loudly on conflict instead of queueing silently forever.Evidence the combined fix works
ab21bd1(#99)Test,Lint,Release Please✅37f1d0f(#100)#99's
GH_PATgives correct attribution; this PR makes the merge call succeed in the first place. Together the full path works: bump merged as a real user → Test/Lint/Release Please fire onmain→fix(deps)cuts a patch release.Verification
The real proof is the next Dependabot PR: it should merge cleanly, and the resulting
maincommit should showTest,Lint, andRelease Pleaseruns.