This document defines when a GitHub Actions check becomes required for branch protection and the process for managing check lifecycle.
Checks that MUST pass before code can be merged to protected branches:
- Core Quality Gates: Linting, type checking, formatting
- Essential Tests: Unit tests, integration tests covering critical paths
- Security Scans: Dependency audits, secret scanning, license checks
- Build Verification: Successful compilation and packaging
Criteria for Required Status:
- Runs on every PR without conditions
- Tests core functionality or quality standards
- Failure indicates genuine issues that should block merge
- Stable and reliable (< 2% flake rate over 30 days)
Checks that provide valuable feedback but should NOT block merges:
- Performance Tests: Benchmarks, load testing
- E2E Tests: Complex end-to-end scenarios (may be flaky)
- Deployment Checks: Staging deployments, smoke tests
- Documentation: README updates, changelog generation
Checks that run only under specific conditions:
- Path-based triggers: Only run when relevant files change
- Schedule-based: Nightly builds, weekly security scans
- Manual triggers: workflow_dispatch events
New or unstable checks in development:
- Beta Features: New testing frameworks, tools
- Research: Proof-of-concept validations
- Temporary: One-off analysis or migration checks
A check can become required when it meets ALL criteria:
- Stability: < 2% failure rate due to infrastructure issues over 30 days
- Relevance: Directly impacts code quality, security, or functionality
- Coverage: Runs on all relevant PRs (not path-conditional)
- Team Agreement: Engineering team consensus on requirement
- Documentation: Clear failure resolution guidelines
Promotion Process:
- Track check stability for 30+ days
- Document check purpose and failure resolution
- Create team RFC for making check required
- Update branch protection rules
- Announce change with 1-week notice
A required check should be deprecated when:
- Superseded: Replaced by better tooling or process
- Unstable: Consistently flaky despite improvement efforts
- Irrelevant: No longer validates meaningful quality criteria
- Redundant: Overlaps with other required checks
Deprecation Process:
- Create deprecation plan with timeline
- Add deprecation notice to check output
- Provide alternative validation method if needed
- Remove from required checks after 2-week notice
- Archive or remove workflow after 30 days
Based on current workflow analysis:
CI - Lint, Test & Build / Build & Docker ImagesCI - Lint, Test & Build / E2E TestsCI - Lint, Test & Build / Lint & Format CheckCI - Lint, Test & Build / Security & Dependency ScanDatabase Monitoring & Health Checks / Database Health Check TestsDatabase Monitoring & Health Checks / Database Performance TestsDatabase Monitoring & Health Checks / Validate Database SchemaDatabase Monitoring & Health Checks / Validate Monitoring ConfigurationDocker Build & Publish / build-and-pushFlakeGuard Test Ingestion / flakeguard-ingestOSV Security Scanner / OSV Vulnerability ScanningSecret Scanning / Gitleaks Secret ScanSecurity Scanning & Dependency Updates / Dependency Vulnerability ScanSecurity Scanning & Dependency Updates / Secret Scanning
- Weekly: Review failed required checks for patterns
- Monthly: Analyze check stability and performance
- Quarterly: Full policy review and check classification audit
Temporarily Bypassing Required Checks:
- Repository admin can override (with justification)
- Create immediate follow-up issue for proper fix
- Restore protection within 24 hours
Incident Response:
- If required check blocks critical fixes, temporarily remove requirement
- Merge critical fix with admin override
- Fix check issue and restore requirement
- Document incident and improve check reliability
The FlakeGuard Branch Protection Auditor automatically analyzes workflows and provides recommendations:
# Run analysis
pnpm --filter @flakeguard/cli exec tsx src/branch-protection-auditor.ts analyze
# Generate updated configuration
pnpm --filter @flakeguard/cli exec tsx src/branch-protection-auditor.ts config > BRANCH_PROTECTION.md
# Update this policy
pnpm --filter @flakeguard/cli exec tsx src/branch-protection-auditor.ts policy > REQUIRED_CHECKS_POLICY.mdThis policy is automatically generated from workflow analysis. Last updated: 2025-09-11