update_branch_protection
Configure branch protection rules to enforce code quality standards, require reviews, and prevent unauthorized changes in GitHub repositories.
Instructions
Update branch protection rules for a branch.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| owner | Yes | Repository owner | |
| repo | Yes | Repository name | |
| branch | Yes | Branch name (e.g. 'main') | |
| required_status_checks_strict | No | Require branches to be up to date before merging | |
| required_status_checks_contexts | No | List of status check contexts required (e.g. ['ci/tests']) | |
| enforce_admins | No | Enforce restrictions for administrators | |
| required_approving_review_count | No | Number of required approving reviews (0-6) | |
| dismiss_stale_reviews | No | Dismiss stale pull request approvals when new commits are pushed | |
| require_code_owner_reviews | No | Require review from code owners | |
| require_last_push_approval | No | Require approval from someone other than the last pusher | |
| required_linear_history | No | Require linear commit history (no merge commits) | |
| allow_force_pushes | No | Allow force pushes to the protected branch | |
| allow_deletions | No | Allow the protected branch to be deleted | |
| block_creations | No | Block branch creation that matches the protection pattern | |
| required_conversation_resolution | No | Require conversation resolution before merging | |
| lock_branch | No | Lock the branch (make it read-only) |