Skip to main content

Branch Protection: Lock Branch

The following rule type is available for locking branches.

stacklok/branch_protection_lock_branch - Whether the branch is locked

Ensure that the branch is locked.

With this setting the branch is marked as read-only. Users cannot push to the branch.

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_lock_branch

Rule parameters

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

  • lock_branch (boolean) - Whether to set the branch as read-only. If this is true, users will not be able to push to the branch.