Branch Protection Status
branch_protection_statusInspect branch protection status and repository rulesets for any branch, revealing required reviews, status checks, and security settings with a clear protected/unprotected conclusion.
Instructions
Read classic branch protection AND repository rulesets for a branch (defaults to the repo's default branch).
Required token scope: repo (or public_repo for public-only repos) with admin/read access to branch protection.
Args:
owner, repo: Repository coordinates.
branch: Optional. Falls back to the repository's default branch.
Returns: Required reviews / status checks / force-push / deletion settings from both classic protection and rulesets, findings by severity, and a protected/partially_protected/unprotected conclusion.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| repo | No | GitHub repo. Falls back to GITHUB_REPO. | |
| owner | No | GitHub owner. Falls back to GITHUB_OWNER. | |
| branch | No | Branch to inspect. Falls back to the repository's default branch. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| repo | Yes | ||
| branch | Yes | ||
| errors | Yes | ||
| findings | Yes | ||
| conclusion | Yes | ||
| enforceAdmins | Yes | ||
| allowDeletions | Yes | ||
| allowForcePushes | Yes | ||
| rulesetRuleTypes | Yes | ||
| requireCodeOwnerReviews | Yes | ||
| classicProtectionEnabled | Yes | ||
| requiredStatusCheckContexts | Yes | ||
| requiredApprovingReviewCount | Yes | ||
| requiredConversationResolution | Yes |