branches
Manage branches, compare refs, and configure branch protection rules. Use 'compare' to see commits reachable from head but not base. Protection actions manage merge requirements, status checks, and push restrictions.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| base | No | Base ref. For compare | |
| head | No | Head ref. For compare | |
| name | No | Protection rule name (glob pattern). For get/update/delete_protection | |
| page | No | Page number. For list | |
| repo | Yes | Repository name | |
| limit | No | Page size. For list | |
| owner | Yes | Repository owner | |
| action | Yes | Operation to perform | |
| branch | No | Branch name. For create/delete | |
| rule_name | No | Glob pattern for the new rule. For create_protection | |
| old_branch | No | Source branch to create from. For create | |
| enable_push | No | Allow whitelisted users/teams to push. For create/update_protection | |
| required_approvals | No | Minimum approving reviews required. For create/update_protection | |
| enable_status_check | No | Require status checks before merging. For create/update_protection | |
| push_whitelist_teams | No | Comma-separated teams allowed to push. For create/update_protection | |
| enable_push_whitelist | No | Restrict direct pushes to whitelist. For create/update_protection | |
| merge_whitelist_teams | No | Comma-separated teams allowed to merge. For create/update_protection | |
| status_check_contexts | No | Comma-separated required status check contexts. For create/update_protection | |
| enable_merge_whitelist | No | Restrict merging to whitelist. For create/update_protection | |
| require_signed_commits | No | Require signed commits. For create/update_protection | |
| dismiss_stale_approvals | No | Dismiss approvals on new pushes. For create/update_protection | |
| protected_file_patterns | No | Semicolon-separated glob patterns of protected files. For create/update_protection | |
| block_on_outdated_branch | No | Block merge when branch is outdated. For create/update_protection | |
| push_whitelist_usernames | No | Comma-separated usernames allowed to push. For create/update_protection | |
| approvals_whitelist_teams | No | Comma-separated teams whose approvals count. For create/update_protection | |
| block_on_rejected_reviews | No | Block merge on rejected reviews. For create/update_protection | |
| merge_whitelist_usernames | No | Comma-separated usernames allowed to merge. For create/update_protection | |
| unprotected_file_patterns | No | Semicolon-separated glob patterns exempt from protection. For create/update_protection | |
| enable_approvals_whitelist | No | Restrict approvals to whitelist. For create/update_protection | |
| push_whitelist_deploy_keys | No | Allow deploy keys to push. For create/update_protection | |
| approvals_whitelist_username | No | Comma-separated usernames whose approvals count. For create/update_protection | |
| block_on_official_review_requests | No | Block merge on pending review requests. For create/update_protection |