branch | string | Required, Identifier | The branch to protect |
owner | string | Required, Identifier | The owner of the repository |
repo | string | Required, Identifier | The repository |
allowDeletions | bool | | Whether branch deletions are allowed |
allowForcePushes | bool | | Whether force pushes are allowed |
blockCreations | bool | | Whether restrictions block branch creation pushes |
dismissalRestrictionTeams | string[] | | Team slugs that can dismiss reviews |
dismissalRestrictionUsers | string[] | | User logins that can dismiss reviews |
dismissStaleReviews | bool | | Whether stale reviews are dismissed on new pushes |
enablePullRequestReviews | bool | | Whether review requirements are enabled |
enforceAdmins | bool | | Whether branch protection is enforced for admins |
lockBranch | bool | | Whether the protected branch is read-only |
pushRestrictionTeams | string[] | | Team slugs allowed to push |
pushRestrictionUsers | string[] | | User logins allowed to push |
requireCodeOwnerReviews | bool | | Whether code owner reviews are required |
requiredApprovingReviewCount | int | | Required number of approving reviews (0-6) |
requiredConversationResolution | bool | | Whether conversations must be resolved before merge |
requiredLinearHistory | bool | | Whether linear history is required |
requiredStatusCheckContexts | string[] | | Required status check contexts |
requireLastPushApproval | bool | | Whether the last push must be approved by another reviewer |
requireSignedCommits | bool | | Whether signed commits are required |
strictStatusChecks | bool | | Whether status checks must be strict |