Skip to main content

BranchProtectionRule

Properties

PropertyTypeAttributesDescription
branchstringRequired, IdentifierThe branch to protect
ownerstringRequired, IdentifierThe owner of the repository
repostringRequired, IdentifierThe repository
allowDeletionsboolWhether branch deletions are allowed
allowForcePushesboolWhether force pushes are allowed
blockCreationsboolWhether restrictions block branch creation pushes
dismissalRestrictionTeamsstring[]Team slugs that can dismiss reviews
dismissalRestrictionUsersstring[]User logins that can dismiss reviews
dismissStaleReviewsboolWhether stale reviews are dismissed on new pushes
enablePullRequestReviewsboolWhether review requirements are enabled
enforceAdminsboolWhether branch protection is enforced for admins
lockBranchboolWhether the protected branch is read-only
pushRestrictionTeamsstring[]Team slugs allowed to push
pushRestrictionUsersstring[]User logins allowed to push
requireCodeOwnerReviewsboolWhether code owner reviews are required
requiredApprovingReviewCountintRequired number of approving reviews (0-6)
requiredConversationResolutionboolWhether conversations must be resolved before merge
requiredLinearHistoryboolWhether linear history is required
requiredStatusCheckContextsstring[]Required status check contexts
requireLastPushApprovalboolWhether the last push must be approved by another reviewer
requireSignedCommitsboolWhether signed commits are required
strictStatusChecksboolWhether status checks must be strict