Destination branches: Inclusion
Per default, a Code Owner file affects pull requests for all destination branch names. You can make a Code Owner file to only apply pull requests with specific destination branches. For that you need to configure the destination_branch_pattern option in your Code Owner file, where you can configure a pattern for matching destination branches in pull requests.
For example, if you want to activate code owners only for pull requests for the destination branch master :
CODEOWNERS.destination_branch_pattern master
If you also want to have pull requests with release branches covered by Code Owners, also add this next line:
CODEOWNERS.destination_branch_pattern release/*
Source branches: exclusion (since 5.1)
Per default, a Code Owners file affects pull requests for all source branches. You can make a Code Owner file to be excluded for pull requests with specific source branches.
For that configure the source_branch_exclusion_pattern option in the Code Owners file.
For example, if you want to ignore code owners for pull requests created by a bot, which creates pull requests with source branches named e.g. like renovate/update-X :
CODEOWNERS.source_branch_exclusion_pattern renovate/*
Used pattern format is similar to the Atlassian branch permission patterns.