Workflow conditions

Match pull requests to a workflow by writing expressions.

Workflows belong to your entire organization, not just a specific repo. Flexible conditions allow you to group pull requests by repo, or across repos.

PullApprove workflow conditions

In general, you'll want to define a workflow if the start-to-finish process for the pull request is different from others in your organization. For example, if you use "staging" branches for testing, you may want developers to freely open and merge PRs as opposed to "main" where you need to get approvals and run through a series of other checks.

Examples:

  • Staging branches: pull.base.ref == "staging"
  • Specific repos: pull.repo == "org/repo" or pull.repo.name.startswith("terraform-")
  • Dependency update PRs: pull.author == "dependabot[bot]"
  • Public vs private contributions: pull.repo.private == False

Workflow conditions vs team conditions

Workflows and review teams both have "conditions".

The rule of thumb is, if the entire process for a pull request is different, then you should use a workflow condition. But if the process is the same and the only difference is who reviews the PR, then you use one workflow and multiple teams with their own conditions.