Features
MergeGuard provides intelligent, policy-driven pull request automation through these key features:
Core Features
📋 Conditional Approvals
Require different reviewers based on files changed, PR size, author, labels, and more. Scale approval requirements dynamically.
🎯 Context-Aware Checks
Only require specific GitHub checks when relevant paths are modified. Reduce CI costs by skipping expensive tests when they're not needed.
🤖 Auto-Approval & Auto-Merge
Automatically approve and merge trusted changes like Dependabot patches or small documentation updates.
🔗 PR Dependencies
Enforce merge order for dependent or stacked PRs. Block merges until parent PRs are complete.
⚡ Priority-Based Rules
When multiple rules match, priority determines which applies. Create emergency fast-tracks that override defaults.
Quick Feature Comparison
| Feature | What It Does | Use Case |
|---|---|---|
| Conditional Approvals | Dynamic reviewer requirements | “Require platform team for infra changes” |
| Context-Aware Checks | Path-based required checks | “Only run E2E tests for backend changes” |
| Auto-Approval | Automatic PR approval | “Auto-approve Dependabot patches” |
| Auto-Merge | Automatic PR merging | “Auto-merge when all requirements met” |
| PR Dependencies | Enforce merge order | “Block child PR until parent merges” |
| Priority Rules | Override default policies | “Emergency label bypasses standard reviews” |
Detailed Documentation
Click any feature to see detailed examples, configuration options, and use cases:
Conditional Approvals →
Learn how to:
- Require teams based on file paths
- Scale approvals with PR size
- Enforce specific user reviews
- Combine approval requirements
Context-Aware Checks →
Learn how to:
- Reduce CI costs with path-based checks
- Skip tests for documentation changes
- Require security scans for infrastructure
- Configure check requirements
Auto-Approval & Auto-Merge →
Learn how to:
- Auto-approve bot updates
- Auto-merge when requirements are met
- Configure merge methods
- Handle check requirements
PR Dependencies →
Learn how to:
- Use
Depends on #123syntax - Detect stacked PRs automatically
- Block merges until parents complete
- Manage dependency chains
Priority-Based Rules →
Learn how to:
- Override default policies
- Create emergency fast-tracks
- Layer rules by specificity
- Handle multiple matches
Example: Combining Features
Here’s a real-world configuration using multiple features together:
rules:
# Priority 10: Emergency hotfix (overrides everything)
- name: "Emergency hotfix"
priority: 10
if:
labels: ["hotfix"]
require:
approvals: 1
users: ["incident-commander"]
action:
autoMerge:
requireChecks: true
mergeMethod: "merge"
# Priority 20: Infrastructure (critical path)
- name: "Infrastructure changes"
priority: 20
if:
paths: ["infra/**", ".github/workflows/**"]
require:
approvals: 2
teams: ["platform-team", "security-team"]
checks:
- "terraform-validate"
- "security-scan"
# Priority 50: Backend (context-aware checks)
- name: "Backend changes"
priority: 50
if:
paths: ["src/backend/**"]
require:
approvals: 1
checks:
- "unit-tests"
- "integration-tests"
- "e2e-tests"
# Priority 60: Docs (skip CI)
- name: "Documentation only"
priority: 60
if:
paths: ["docs/**"]
excludePaths: ["src/**"]
require:
approvals: 1
# No checks required!
# Priority 70: Dependabot (auto-merge)
- name: "Dependabot patches"
priority: 70
if:
author: "dependabot[bot]"
semverLevel: ["patch", "minor"]
require:
checks: ["security-scan"]
action:
autoApprove: true
autoMerge:
requireChecks: true
mergeMethod: "squash"
# Priority 100 (default): Everything else
- name: "Default policy"
require:
approvals: 2
This configuration:
- Emergency hotfixes bypass normal reviews (priority 10)
- Infrastructure requires both teams (priority 20)
- Backend runs full test suite (priority 50)
- Docs skip expensive CI (priority 60)
- Dependabot patches auto-merge (priority 70)
- Everything else needs 2 approvals (priority 100)
Next Steps
- Quickstart Guide - Get started with basic setup
- Why MergeGuard? - Understand the problem we solve
- Install MergeGuard - Add to your repository