branches
Scopes can be filtered by the target (base) and source (head) branches of a pull request. This lets you define branch-specific review rules within a single configuration file. Note that paths are still required.
The syntax is the same as the top-level branches setting — simple patterns match the base branch, and range patterns (.. or ...) match both base and head.
# CODEREVIEW.toml
[[scopes]]
name = "main-review"
paths = ["**/*"]
branches = ["main"]
reviewers = ["senior-dev1", "senior-dev2"]
require = 2
[[scopes]]
name = "develop-review"
paths = ["**/*"]
branches = ["develop"]
reviewers = ["dev1", "dev2"]
require = 1
Range patterns
Use .. or ... to match both base and head branches, following git convention (base..head). Omitting one side matches any branch for that position — for example, develop.. means "base must be develop, any head branch".
[[scopes]]
name = "release-to-main"
paths = ["**/*"]
branches = ["main..release/*"]
reviewers = ["release-manager"]
require = 1
[[scopes]]
name = "targeting-develop"
paths = ["**/*"]
branches = ["develop.."] # any branch merging into develop
reviewers = ["dev1", "dev2"]
require = 1
Combining with config-level branches
Scope-level branches work independently from the top-level branches setting. The top-level setting gates whether PullApprove runs at all, while scope-level branches controls which scopes are active for a given PR.
# Only run on PRs targeting main or develop
branches = ["main", "develop"]
[[scopes]]
name = "strict-main-review"
paths = ["**/*"]
branches = ["main"]
reviewers = ["senior-dev1", "senior-dev2"]
require = 2
[[scopes]]
name = "standard-review"
paths = ["**/*"]
branches = ["develop"]
reviewers = ["dev1", "dev2"]
require = 1
Using with aliases
Branches can reference aliases:
[aliases]
protected-branches = ["main", "develop"]
[[scopes]]
name = "protected-review"
paths = ["**/*"]
branches = ["$protected-branches"]
reviewers = ["senior-dev1", "senior-dev2"]
require = 2