Add workflow to auto-merge Dependabot PRs - #278
Merged
Merged
Conversation
Uses pull_request_target to get write permissions without exposing secrets to PR code (no checkout step). Approves the PR and enables GitHub auto-merge, which waits for all required status checks to pass before merging. https://claude.ai/code/session_01UWiK5bH6Be6vft43zVVNbH
The auto-merge workflow requires repo settings (allow auto-merge, branch protection) that can't be codified in files. Exclude it from the template so generated repos don't ship with a broken workflow. https://claude.ai/code/session_01UWiK5bH6Be6vft43zVVNbH
Instead of pull_request_target + --auto (which requires branch protection and the "Allow auto-merge" repo setting), trigger on workflow_run after the Test workflow succeeds. This merges directly once tests pass, with no repo settings required. Security: workflow_run always runs base branch code, never checks out PR code, and the PR author is verified both via the event actor and a redundant API check. https://claude.ai/code/session_01UWiK5bH6Be6vft43zVVNbH
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.
Uses pull_request_target to get write permissions without exposing
secrets to PR code (no checkout step). Approves the PR and enables
GitHub auto-merge, which waits for all required status checks to
pass before merging.
https://claude.ai/code/session_01UWiK5bH6Be6vft43zVVNbH