Repository navigation
fix(dependabot-merge): approve the PR before merging so the review ruleset allows it - #8
Merged
Merged
Conversation
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.
What & why
Dependabot auto-merge has never merged anything. Every eligible bump passes the checks, reaches
gh pr merge, and GitHub refuses it with "the base branch policy prohibits the merge": the org's "Review required" ruleset wants one approval and the workflow never gives one. charge-cars-website alone has 23 failed runs, and its bumps piled up until someone merged them by hand. Every repo that calls this workflow has the same problem.The workflow now approves the PR right before merging, after every existing check has passed (CI green on the latest run, stable patch or minor bump, release old enough). The approval goes through the reviews API with
commit_idset to the head CI ran on, so a commit pushed afterwards is never approved, and the merge keeps--match-head-commit.The org ruleset doesn't dismiss stale approvals on push (checked in all 8 callers). So if the merge fails after approving, the workflow dismisses its own approval and fails the job; otherwise the approval would stay and a later push could merge without a human review. If the dismissal itself is refused, the job logs an error naming the review to dismiss by hand.
The approval needs "Allow GitHub Actions to create and approve pull requests". It is on in all 8 repos that call this workflow (charge-cars-website, curiosus-website, fluid-simulation, lenis-showcase-admin, oss-website, satus, the-gauge, x-website). The README now says so.
How to verify
automerge-dependabot.yml). The next eligible Dependabot PR should get agithub-actionsapproval and then merge.actionlint .github/workflows/dependabot-merge.ymlreports only the existing SC2129 style note on the update-type step. The new lines add nothing.Checklist