# `branches` PullApprove runs when a `CODEREVIEW.toml` is found in the branch's base commit. The configuration is always pulled from the base branch, which means a PR can't modify the requirements for its own review. There may be branches where the `CODEREVIEW.toml` is present, but you don't want PullApprove to run (usually because it will run later in a subsequent PR). The top-level `branches` setting can be used to define when PullApprove runs. ```toml branches = ["main", "develop"] ``` Branch names are evaluated using fnmatch syntax, and can also use git-style range syntax to specify both head and base branches. ```toml branches = [ "main", # base only "release/*", # base with pattern "develop..feature/*", # base and head "develop..", # base only (any head) ] ``` ## Advanced branch patterns ### Range syntax with `..` and `...` PullApprove supports two types of range syntax for matching branch combinations: #### Two-dot syntax (`..`) The `..` syntax matches pull requests where the base (target) branch matches the left pattern and the head (source) branch matches the right pattern. This follows git convention where `A..B` refers to changes from A to B. ```toml branches = [ "develop..feature/*", # feature branches → develop "main..hotfix/*", # hotfix branches → main "main..release/*", # release branches → main ] ``` #### Three-dot syntax (`...`) The `...` syntax works the same as `..` - it matches base and head branch patterns. ```toml branches = [ "develop...feature/*", # equivalent to develop..feature/* "main...hotfix/*", # equivalent to main..hotfix/* ] ``` ### Base-only and head-only patterns You can match only the base or head branch by omitting one side of the range: ```toml branches = [ "develop..", # any branch → develop "..feature/*", # feature/* → any branch ] ``` ### Pattern matching examples ```toml branches = [ # Simple base branch matching "main", "develop", "release/*", # Feature branch workflow "develop..feature/*", # features merge to develop "main..develop", # develop merges to main "main..hotfix/*", # hotfixes merge to main # Release workflow "main..release/*", # releases merge to main "develop..release/*", # releases also merge back to develop # Base-only patterns "main..", # any branch merging to main "develop..", # any branch merging to develop ] ``` ### Complex workflow example For a GitFlow-style workflow: ```toml branches = [ # Development "develop..feature/*", "develop..bugfix/*", # Releases "main..develop", "main..release/*", "develop..release/*", # Hotfixes "main..hotfix/*", "develop..hotfix/*", ] ```