View as Markdown

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.

Every 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:
- WIP

Here, any pull request whose title contains WIP gets the WIP label. Once the title no longer matches, Mergify removes it.

Mergify 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.

Was this page helpful?