Skip to main content

Branch Protection: Require Pull Request Code Owners Review

The following rule type is available for requiring a review from code owners.

stacklok/branch_protection_require_pull_request_code_owners_review - Verifies that a branch requires review from code owners

Ensure that the setting to require an approved review in pull requests including files with a designated code owner is enabled for the branch protection rule.

This requires an approved review in pull requests including files with a designated code owner.

For more information, see https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/managing-protected-branches/managing-a-branch-protection-rule

Entity

  • repository

Type

  • stacklok/branch_protection_require_pull_request_code_owners_review

Rule parameters

The stacklok/branch_protection_require_pull_request_code_owners_review rule supports the following parameters:

  • branch (string) - The name of the branch to check. If left empty, the default branch will be used.

Rule definition options

The stacklok/branch_protection_require_pull_request_code_owners_review rule supports the following options:

  • require_code_owner_reviews (boolean) - Set to true to require an approved review in pull requests including files with a designated code owner.