Adding Pull Request Approval Rules
Written for the Old UI
This article was written for the old UI. The instructions are still usable, but the screenshots are outdated. In some cases, items referenced in the instructions have moved or changed. If you cannot find an item, see the Where Did It Go article.
Overview
This article explains how a Pull Request Approval Rule works and how to add one. By default, a Pull Request does not require any reviews before it can be merged. With a Pull Request Approval Rule, administrators can enforce a minimum number of approvals before a Pull Request can be merged. Each rule defines which branches it applies to and how many approvals are required. The target branch of a Pull Request determines how many approvals it requires.
The rule can be configured with different scopes:
All Branches: The rule applies to any branch not covered by a more specific rule.
Select: The rule targets one or more explicitly selected branches.
Pattern: The rule uses wildcard syntax to match branches by naming convention (e.g.,
feature/*,release/v*,hotfix-*).
Pull Request Example
The following screenshot shows a Pull Request with an Approval Rule applied.

Rule Hierarchy
When a rule's selected branches overlap with another rule, precedence determines which rule applies to the overlapping branch. The order of precedence, from highest to lowest, is:
Select > Pattern > All Branches
The following screenshot shows two rules: one applies to All Branches, and the other applies only to the main branch. Because the Select rule takes precedence over the All Branches rule, any Pull Requests that target the main branch require 3 approvals instead of the 1 approval required for other branches.

Adding Approval Rules
Select Branches
There are three methods for selecting which branches the Approval Rule will apply to.

All Branches
This selection applies the rule to every branch in your DevOps tenant.
Select the All branches option.
Select
This selection applies the rule to only the branches you select from the list.
Select the Select option.
Click the Select branches dropdown menu.
Select each of the branches to apply this rule to.

Pattern
This selection applies the rule to any branches that match the pattern you enter. You can add the wildcard character to the end of a pattern (*) to match branches that start with your pattern and end with any other characters. For example, if you use the pattern feature/*, the table below shows how this rule affects your branches.
main
feature/addAccount
feature/removeAccount
release/v1.2.3
Select the Pattern option.
Enter the pattern to use for this rule in the textbox.

Last updated
Was this helpful?





