Configuration
Merge method to use: “merge”, “squash”, or “rebase”
Custom title for the merge commit (supports templates)
Custom message for the merge commit (supports templates)
Basic Usage
Examples
Simple Auto-Merge
Automatically merge PRs that pass all validations:Custom Commit Messages
Specify custom titles and messages for merge commits:Conditional Auto-Merge
Merge documentation PRs automatically after review:Merge Methods
- Merge
- Squash
- Rebase
Creates a merge commit that preserves all commit history from the PR branch.Best for: Preserving detailed history and context of changes.
How It Works
1
Check Mergeability
The action first checks if the PR is mergeable
2
Process Templates
If custom commit titles or messages are provided, it processes the templates
3
Perform Merge
The action merges the PR using the specified method
Error Handling
The Merge Action will fail under these conditions:- PR has merge conflicts
- PR doesn’t meet branch protection requirements
- Required status checks are failing
- User lacks permission to merge
Use Cases
Auto-Merge Dependency Updates
Automatically merge dependency updates that pass tests:Auto-Merge Typo Fixes
Automatically merge simple typo fixes after approval:Auto-Merge for Specific Labels
Merge PRs with specific labels after CI success:Best Practices
Use with appropriate validation checks to ensure quality
Consider branch protection rules when setting up auto-merge
Choose the merge method that best fits your workflow
Use custom commit messages to maintain a meaningful history
Be cautious with auto-merge on critical branches - always include sufficient validation
Security Considerations
- Only enable auto-merge for trusted contributors or with strict validation
- Ensure all required checks (tests, approvals) are passing before merge
- Consider limiting auto-merge to non-critical repositories or branches
- Maintain audit logs of auto-merged PRs