Fix Dependabot auto-merge without repository auto-merge setting#156
Merged
Conversation
The workflow failed because the repository has allow_auto_merge disabled and main requires linear history, so gh pr merge --auto --merge could never succeed. Approve patch and minor Dependabot PRs on pull_request_target, then squash merge them after CI completes via workflow_run once branch rules are satisfied. Co-authored-by: Jan Willem Kaper <kapersoft@users.noreply.github.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
Dependabot PRs (#153, #154) were stuck because the
dependabot-auto-mergeworkflow failed with:Additionally,
mainrequires linear history, so merge commits (gh pr merge --merge) are rejected even when requirements are met.Changes
pull_request_target(required by branch rules: 1 approval + last-push approval).workflow_run, oncemergeStateStatusisCLEANand the PR is approved.gh pr merge --auto --merge, which depends on the repository-level "Allow auto-merge" setting (allow_auto_mergeis currentlyfalse).After merge
Re-run the dependabot-auto-merge workflow on open Dependabot PRs (#153, #154), or comment
@dependabot rebaseto re-trigger checks and approval.Repository setting (optional)
Enabling Settings → General → Pull Requests → Allow auto-merge would allow a simpler
--autoworkflow in the future, but is not required with this fix.