GitHub Ruleset Runbook (Default Branch)¶
Status: operational closure guide Last updated: 2026-05-28
This runbook closes the remaining gap that cannot be enforced purely from repository code: GitHub branch protection/ruleset settings for the repository's active default branch.
In this repo, the default branch is currently master, not main.
1. Prerequisites¶
- Admin or maintainer access to repository settings.
- Required checks source of truth:
docs/required_status_checks.json - Policy reference:
docs/BRANCH_PROTECTION_POLICY.md
2. Configure Ruleset (Recommended)¶
Path in GitHub UI:
- Repository -> Settings -> Rules -> Rulesets
- New ruleset -> Branch ruleset
Target branches:
- The repository's default branch (
masterin this repo) - Any additional release branches you actually use
Enable rules:
- Require a pull request before merging
- Require approvals: at least 1
- Dismiss stale pull request approvals when new commits are pushed
- Require conversation resolution before merging
- Require status checks to pass
- Restrict force pushes
- Restrict deletions
Required status checks (exact names):
cognitive-quality-gatespolicy-bundle-governanceruntime_canary
Bypass control:
- Keep bypass list minimal (prefer admin-only)
- Do not allow broad team bypass for routine pushes
3. If Using Legacy Branch Protection Instead of Rulesets¶
Path in GitHub UI:
- Repository -> Settings -> Branches -> Branch protection rules
Create/update rules for main and master with the same controls and required checks listed above.
4. Verify Operationally¶
After saving settings, verify with in-repo tooling.
Local manual check (may be unverified without token permissions):
python tooling/verify_github_branch_protection.py --report-file artifacts/github_branch_protection_report.json
This verifier reads the active branch rules applied by GitHub rulesets for the target branch, so it matches the ruleset UI more closely than the legacy branch-protection-only endpoint.
CI governance check:
policy-bundle-governancein.github/workflows/ci.ymlruns:tooling/verify_github_branch_protection.py- Report artifact:
artifacts/github_branch_protection_report.json
Interpretation:
status = passed: settings verified by API and required checks foundstatus = unverified: token/permission limitation; use admin token or manual UI confirmationstatus = failed: configuration mismatch that must be fixed
5. Change Management Rule¶
Any change to required checks must update all of:
docs/required_status_checks.jsondocs/BRANCH_PROTECTION_POLICY.md- GitHub ruleset/branch-protection required checks list
Then validate:
python tooling/verify_required_status_checks_consistency.py
python tooling/verify_branch_protection_policy.py
6. Audit Checklist (Production Promotion)¶
Before marking a promotion as Go, confirm and record:
- Default branch ruleset/branch protection is enabled
- Required status checks exactly match
docs/required_status_checks.json - PR review requirements are enabled (minimum approvals and stale review dismissal)
- Force push/deletion restrictions are enabled
- Bypass list is explicitly reviewed and limited
tooling/verify_github_branch_protection.pyreport captured
Evidence to attach in PR/release notes:
artifacts/github_branch_protection_report.json- link or screenshot of GitHub ruleset configuration
- last successful run IDs for
policy-bundle-governanceandruntime_canary