9. Required checks & merge gates
CI/CD Pipelines · 48 pages source format
Branch protection + required status checks prevent merging broken code. Balance safety vs team velocity.
What you'll learn
- Branch protection rules
- Required status checks
- CODEOWNERS
- Merge queues awareness
Branch protection on main
Require PR, require status checks, no direct push (for team repos). Solo: still practice config.
Do this now
Enable require status checks before merge. List required check names.
Failure injection test
Break test on PR. Confirm merge button blocked. Fix. Confirm unblocked.
Do this now
Document result in GATES.md with screenshot.
CODEOWNERS (awareness)
.github/CODEOWNERS auto-requests review for paths — tests/ owned by QA.
Do this now
Add CODEOWNERS assigning workflows to yourself. Note how it would scale.
When gates hurt
Too many required checks → rubber stamp. Pick smoke + lint + test as minimum.
Do this now
Write gate policy: required vs optional checks in GATES.md.