Manage Branches
manage_branchesGet, update, or delete GitHub branch protection rules and list repository branches by setting the action field; enforce reviews, status checks, and push restrictions.
Instructions
Manage GitHub Branch Protection: get, update, and delete a branch's protection rules; list repository branches. Use the action field to select the operation.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| page | No | Page number (list_branches) | |
| repo | No | Repository name (defaults to the configured GITHUB_REPO) | |
| owner | No | Repository owner (defaults to the configured GITHUB_OWNER) | |
| action | Yes | The branch protection operation to perform | |
| branch | No | Branch name — required for get_protection, update_protection, and delete_protection | |
| perPage | No | Results per page (list_branches) | |
| protected | No | Filter to only protected branches (list_branches) | |
| lock_branch | No | ||
| restrictions | No | Restrict who can push to the branch — pass null to disable restrictions (update_protection) | |
| enforce_admins | No | Whether the restrictions also apply to repository admins (update_protection) | |
| allow_deletions | No | ||
| block_creations | No | ||
| allow_force_pushes | No | ||
| allow_fork_syncing | No | ||
| required_status_checks | No | Required status checks — pass null to disable the requirement (update_protection) | |
| required_linear_history | No | ||
| required_pull_request_reviews | No | Required pull request review rules — pass null to disable the requirement (update_protection) | |
| required_conversation_resolution | No |