Mergify| Docs

Dismiss Reviews

Dismiss previous reviews on a pull request.


The dismiss_reviews action allows Mergify to automatically dismiss approved or changes requested reviews when new commits are pushed to the pull request.

The dismiss_reviews action is a powerful tool that can help maintain the freshness and relevance of reviews in your pull request workflow.

Parameters

Key nameValue typeDefault
approvedboolean, from_requested_reviewers or list of

GitHub login

true

If set to true, all the approving reviews will be removed when the pull request is updated. If set to false, nothing will be done. If set to a list, each item should be the GitHub login of a user whose review will be removed. If set to from_requested_reviewers, the list of requested reviewers will be used to get whose review will be removed.

changes_requestedboolean, from_requested_reviewers or list of

GitHub login

true

If set to true, all the reviews requesting changes will be removed when the pull request is updated. If set to false, nothing will be done. If set to a list, each item should be the GitHub login of a user whose review will be removed. If set to from_requested_reviewers, the list of requested reviewers will be used to get whose review will be removed.

message

template

Pull request has been modified.

The message to post when dismissing the review.

whensynchronize or alwayssynchronize

If set to synchronize, the action will run only if the pull request commits changed. Otherwise, it will run each time the rule matches.

Examples

Re-Review

pull_request_rules:
- name: dismiss reviews when new commits are pushed, if the label "re-review" is present
conditions:
- base=master
- label=re-review
actions:
dismiss_reviews:

In this example, Mergify will automatically dismiss any reviews when new commits are pushed to a pull request targeting the master branch, but only if the pull request has been labeled with "re-review".

Team-based Dismiss

You could also only dismiss the outdated reviews if the author is not a member of a particular team. This allows to keep the approval if the author is trusted, even if they update their code:

pull_request_rules:
- name: remove outdated reviews for non trusted authors
conditions:
- base=main
- author!=@mytrustedteam
actions:
dismiss_reviews:
Edit on GitHub

Company

  • About Us
  • Careers
  • Customers
  • Media Kit

Products

Community

Help