Modern QA2026Configuring Gates in GitHub — tiles
Log inJoin
45 / 48 · 16 CI/CD Pipelines · Quality Gates← prev⊞ allnext →☰ Read as one page

7.3Configuring Gates in GitHub

Branch Protection Rules

  1. Go to Settings > Branches > Branch protection rules
  2. Add a rule for main
  3. Enable "Require status checks to pass before merging"
  4. Select the specific checks that must pass (e.g., unit-tests, lint, security-scan)
  5. Enable "Require branches to be up to date before merging" (ensures the PR is tested against the latest main)
  6. Enable "Require pull request reviews before merging" (human gate)

Required vs Optional Checks

Not every check needs to be required. Use required checks for gates that must never be bypassed, and optional checks for informational feedback.

Check Required? Rationale
Unit tests Yes Broken logic must not reach main
Lint / format Yes Consistent code style is non-negotiable
Integration tests Yes API and database issues must be caught
Browser tests Yes (on main) UI regressions must be caught before deploy
Coverage (patch) Yes New code must be tested
Coverage (overall) No Legacy code coverage should improve over time, not block PRs
Security scan Yes (high/critical) Critical vulnerabilities must not ship
Performance budget No (initially) Start as informational, promote to required once budgets are stable