Restrictions are a set of rules that a pull request must follow. They don't have anything to do with human code review, but are programmatic rules to make sure PRs are following your team's conventions. Code review workflows don't start if there are any failing restrictions — the author needs to fix these issues first.
Examples of restrictions:
- Require linked issues or tickets
- Enforce a branch naming pattern
- Require PRs to be labeled
- Require PR titles to match a pattern
- Prevent certain files from being modified
- Require PR descriptions to contain specific strings
- Ensure committers use your team's email domain
Failed restrictions will show a "failing" status on GitHub.
Targeting pull requests or repos with conditions
Restrictions can apply globally across all installed repos, or you can write expressions to target them to specific pull requests using repo names, topics, languages, visibility, and more.