If you have any questions, feedback, or issues please let us know via GitHub Issues or by using Intercom on pullapprove.com.

conditions

A pro plan is required to use this feature on private repos.

Conditions allow you to decide when a group should or should not need to review a PR.

There are three elements that you can use to determine this:

  • files - the files changed by the PR
  • branches - the branch that the PR is merging from or into
    • Written as a list of branch names
    • Can use the git range syntax to specify the base and head branches (i.e. deploy...master for merging into deploy, from master)
    • Can also use ...staging to just specify pulls from staging into any other branch
  • labels - lables on the PR

Each of these conditions can contain a simple list of items that can match, which if present would mean that the group needs to review the PR. Or you can use specific include and exclude fields for more specific logic.

Example usage for files:

groups:
  docs-team:
    conditions:
      files:
        - "docs/*"  # review if edited anything in docs
        - "*.md"  # review if edited any markdown files
    required: 1
    users:
      - userone
      - usertwo

  pullapprove-admins:
    conditions:
      files:
        - ".pullapprove.yml"  # great for ensuring pullapprove settings are approved
    required: 1
    users:
      - superuser

  devs:
    conditions:
      files:
        exclude:  # don't need to review if the PR only changes these files
          - ".bumpversion.cfg"
          - "setup.py"

Example usage for branches:

groups:
  deploy:
    conditions:
      branches:  # only need to review if merging into a deployable branch
        - staging
        - deploy
    required: 1
    users:
      - userone
      - usertwo

  master-deploy:
    conditions:
      branches:
        - "deploy...master"  # only need to review if merging into deploy, from master
    required: 1
    users:
      - userone
      - usertwo

  from-staging:
    conditions:
      branches:
        - "...staging"  # review if merging from staging, into any other branch
    required: 1
    users:
      - userone
      - usertwo

  specifics:
    conditions:
      branches:
        # review merges into master, but not into master from staging
        include:
          - master
        exclude:
          - master...staging
    required: 1
    users:
      - userone
      - usertwo

Example usage for labels:

groups:
  bugs:
    conditions:
      labels:
        - bug
    required: 1
    users:
      - userone
      - usertwo

  skippable-review-team:
    conditions:
      labels:
        exclude:
          - skip-review  # don't need to review if it has the "skip-review" label
    required: 1
    users:
      - superuser