Skip to content

Branch protection setup instructions - #6

Closed
dogmar wants to merge 1 commit into
mainfrom
claude/branch-protection-setup
Closed

dogmar wants to merge 1 commit into
mainfrom
claude/branch-protection-setup

Conversation

@dogmar

@dogmar dogmar commented Mar 27, 2026

Copy link
Copy Markdown
Collaborator

Manual setup

No code changes required. Go to Settings > Rules > Rulesets and create the following two rulesets:


Ruleset 1: "Require CI" (no one can bypass)

Setting Value
Enforcement Active
Bypass list Empty — leave blank
Target branches Include default branch (main)
Branch rules
↳ Require a pull request before merging ✅ Enabled
    ↳ Required approvals 0
↳ Require status checks to pass ✅ Enabled
    ↳ Add checks test, autofix, Publish Dry Run
↳ Block force pushes ✅ Enabled

This ensures CI must pass for everyone (including you) and no one can force push to main.


Ruleset 2: "Require reviews for collaborators" (dogmar can bypass)

Setting Value
Enforcement Active
Bypass list Add: @dogmar
Target branches Include default branch (main)
Branch rules
↳ Require a pull request before merging ✅ Enabled
    ↳ Required approvals 1

Since you're on the bypass list, your own PRs skip the review requirement. Collaborator PRs need 1 approval.


End result

Scenario CI must pass Review required
dogmar's PRs ✅ Yes ❌ No (bypass)
Collaborator PRs ✅ Yes ✅ Yes (1 approval)
Anyone bypasses CI 🚫 Impossible
Anyone force pushes 🚫 Impossible

Why two rulesets?

Bypass lists apply to the entire ruleset. A single ruleset would either let you bypass CI (bad) or force you to get reviews (not wanted). Splitting them gives granular control: you bypass only the review requirement, never CI.


Close this PR once both rulesets are configured.

https://claude.ai/code/session_01QCPv9A7pkCeR42zoJ9fujU

Marks @dogmar as code owner for all files. When combined with GitHub
rulesets requiring code owner reviews, this ensures collaborator PRs
need dogmar's approval while dogmar can bypass the review requirement.

https://claude.ai/code/session_01QCPv9A7pkCeR42zoJ9fujU
@dogmar dogmar closed this Mar 27, 2026
@dogmar dogmar changed the title Add CODEOWNERS for branch protection setup Branch protection setup instructions Mar 27, 2026
@dogmar dogmar reopened this Mar 27, 2026
@dogmar dogmar closed this Mar 27, 2026
@dogmar dogmar reopened this Mar 27, 2026
@dogmar dogmar closed this Mar 30, 2026
@dogmar
dogmar deleted the claude/branch-protection-setup branch March 30, 2026 20:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant