Review
Automate reviews for your pull requests with customizable comments and review types.
The review action provides you with an automated way to review pull requests.
This can be particularly useful in situations where you want to automatically
approve pull requests that meet certain criteria, or to request changes on a
pull request when a particular check fails.
How Reviews Are Posted
Section titled How Reviews Are PostedMergify applies these rules when it posts a review:
-
Mergify skips a review whose type and body already match one it posted on the pull request. It posts the review again if it has posted the opposite type since: an
APPROVEafter aREQUEST_CHANGES, or the reverse. -
That comparison only covers reviews posted under the same account, so changing
bot_accountmakes Mergify post an otherwise identical review again under the new one. -
On a merged pull request, only
COMMENTis posted.APPROVEandREQUEST_CHANGESare ignored, and the action still reports a success — a green check there is not proof that a review was posted. -
A
REQUEST_CHANGESorCOMMENTreview with nomessageis posted with a default body. Setmessageto choose the wording yourself.
Parameters
Section titled Parametersbot_account#Mergify can impersonate a GitHub user to review a pull request. If no bot_account is set, Mergify will review the pull request itself.
message#The message to post in the review
type#The type of review to post
Examples
Section titled ExamplesApprove a pull request when all checks have passed
Section titled Approve a pull request when all checks have passedpull_request_rules: - name: automatic approval conditions: - check-success = myfirstCIname - check-success = mysecondCIname actions: review: type: APPROVEIn this example, Mergify will automatically approve any pull request once all checks have passed successfully.
Approve Dependabot Pull Requests
Section titled Approve Dependabot Pull RequestsYou can use Mergify to review a pull request on your behalf. This can be handy if you require a minimum number of reviews to be present on a pull request (e.g., due to branch protection) but want to automate some merges.
Dependabot is the bot behind GitHub’s
automatic security updates. It sends automatic updates for your project’s
dependencies, making sure they are secure. You can automate the approval of
pull requests created by dependabot with a rule such as:
pull_request_rules: - name: automatic approval for Dependabot pull requests conditions: - author = dependabot[bot] actions: review: type: APPROVE message: Automatically approving dependabotWas this page helpful?
Thanks for your feedback!