Skip to main content

Branch Protection: Enabled

The following rule type is available for enabling branch protection.

stacklok/branch_protection_enabled - Verifies that a branch has a branch protection rule

Verify that the branch has a branch protection rule set up.

You can protect important branches by setting branch protection rules, which define whether collaborators can delete or force push to the branch and set requirements for any pushes to the branch, such as passing status checks or a linear commit history.

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_enabled

Rule parameters

The stacklok/branch_protection_enabled 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_enabled rule supports the following options:

  • None