require-azure-pipelines-pr-branches
Require explicit pull-request branch filters in Azure Pipelines.
Targeted pattern scopeâ
- Root
pr:configuration inazure-pipelines.yml. prblocks missing explicit branch filters.
What this rule reportsâ
This rule reports Azure Pipelines configs where PR validation scope is not explicitly declared.
Why this rule existsâ
Explicit PR branch filters prevent accidental scope drift (for example, PR checks running on every branch or no branch at all). Keeping those filters in version control improves reviewability.
â Incorrectâ
pr:
autoCancel: true
â Correctâ
pr:
branches:
include:
- main
When not to use itâ
Disable this rule if your repository intentionally relies on implicit PR validation scope.
Rule catalog ID: R082