Branch Protection Status
branch_protection_statusInspect a GitHub branch's protection settings and rulesets to verify required reviews, status checks, force-push and deletion rules, returning findings and a protection verdict.
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, verification gaps, and a protected/partially_protected/unprotected/unknown 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 | ||
| trustBoundary | No | ||
| allowDeletions | Yes | ||
| allowForcePushes | Yes | ||
| rulesetRuleTypes | Yes | ||
| rulesetsVerified | Yes | ||
| verificationGaps | Yes | ||
| requireCodeOwnerReviews | Yes | ||
| classicProtectionEnabled | Yes | ||
| classicProtectionVerified | Yes | ||
| requiredStatusCheckContexts | Yes | ||
| requiredApprovingReviewCount | Yes | ||
| requiredConversationResolution | Yes |