Skip to main content

Branch Protection: Allow Deletions

The following rule type is available for allowing deletions on branches.

stacklok/branch_protection_allow_deletions - Whether the branch can be deleted

Ensure that the "Allow deletions" setting is enabled for the branch protection rule.

Allow users with push access to delete matching branches.

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_allow_deletions

Rule parameters

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

  • allow_deletions (boolean) - Allows deletion of the protected branch by anyone with write access to the repository.