Protected Branches and CI
Production repositories commonly protect important branches. Protection can require pull requests, successful CI checks, reviews, signed commits, or status checks before integration.
CI should validate important properties such as tests, linting, type checking, security scanning, and build success. Local hooks improve developer feedback but should not be the only enforcement mechanism.
Key Takeaways
- Protected branches reduce accidental direct changes.
- CI provides centralized and repeatable validation.
- Server-side checks are more reliable than relying only on local hooks.
Knowledge Check
Why should critical checks also run in CI if pre-commit hooks already exist?