PullApprove Conditions

pullapprove_conditions allow you to determine which PRs need to be reviewed and which don't. Often times, people don't need to review "work in progress" PRs or PRs that are being merge into specific branches (i.e. for further development or testing). This is a top-level setting which completely enables or disables PullApprove (including notifications).

By default there are no pullapprove_conditions and every PR is up for review (depending on the conditions of each group). If not specified (see below), PullApprove will return a "success" status to GitHub if any conditions are not met so that PRs are still mergeable if PullApprove is a required status check. To change the status or the explanation that goes with it, you can use the more complex syntax for defining conditions.

version: 3
- "'WIP' not in title"  # only review if not marked as work in progress
- "base.ref == 'master'"  # only review things being merged into master
- "'*travis*' in statuses.successful"  # only review if tests have already passed
- "'hotfix' not in labels"  # let hotfix PRs go through without review

# review groups are only evaluated if all of the pullapprove_conditions are true

For more details on what kinds of conditions you can write, look here.

Success status from pullapprove when conditions are not met

Changing the status or explanation

You can further tweak the behavior of pullapprove_conditions by specifying the status and explanation that are returned to GitHub when one of the conditions is not met. The conditions are evaluated in order, and the first one to fail will be the one to set the status and explanation in GitHub.

version: 3
- condition: "base.ref == 'master'"
  unmet_status: success
  explanation: "Review not required unless merging to master"
- "'hotfix' not in labels"  # when using the string type, the default status is "success"
- condition: "'WIP' not in title"
  unmet_status: pending
  explanation: "Work in progress"
- condition: "'*travis*' in statuses.successful"
  unmet_status: failure
  explanation: "Tests must pass before review starts"

# review groups are only evaluated if all of the pullapprove_conditions are true
Pending status for WIP pull request from pullapprove when conditions are not met






© 2020 Dropseed, LLC