Workflow Automation
Automate the routine work on your pull requests with rules that react to a pull request's state to label, comment, assign, rebase, merge, and more.
Workflow Automation handles the routine work on your pull requests. You write rules in your Mergify configuration file, and Mergify carries them out: labeling, commenting, assigning, rebasing, merging, and more. Your team spends less time on pull request housekeeping.
Anatomy of a Rule
Section titled Anatomy of a RuleEvery rule lives under pull_request_rules and pairs a set of conditions
with the actions to run when a pull request matches them:
pull_request_rules: - name: add "WIP" label when the title contains "WIP" conditions: - title ~= WIP actions: label: toggle: - WIPHere, any pull request whose title contains WIP gets the WIP label. Once the
title no longer matches, Mergify removes it.
How Rules Are Evaluated
Section titled How Rules Are EvaluatedMergify evaluates the state of a pull request rather than individual events. It checks the current status of a pull request and acts based on the conditions you defined. This behavior is known as “edge triggering”: an action only re-runs for a pull request when its state flips back from unmatched to matched.
Building Blocks
Section titled Building BlocksRule Syntax
The pull_request_rules format and how to structure a rule.
Conditions
Match pull requests on title, labels, CI status, files, authorship, and more.
Actions
The full catalog of tasks Mergify can run when a rule matches.
Configuration File
Where rules live and how the overall config file is structured.
Popular Actions
Section titled Popular ActionsMerge
Automate the merging of your pull requests.
Queue
Add the pull request to the merge queue.
Label
Add, remove, or toggle labels on a pull request.
Comment
Post a comment on a pull request.
Backport
Copy a pull request to another branch once it is merged.
Rebase
Rebase the pull request on top of its base branch.
Was this page helpful?
Thanks for your feedback!