Branch Protection Status
branch_protection_statusCheck branch protection status and ruleset compliance for any branch, identifying required reviews, status checks, and security gaps to verify protection completeness.
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 |