Ensure all required status checks pass before merging
Framework Reference: A.8.25 (Secure Development Lifecycle) Integration: GitHub – Branch Protection
Why this matters
Status checks validate that code changes meet quality, security, and compliance standards before they are merged.
These checks can include automated tests, linting, build verification, vulnerability scans, or CI/CD pipelines.
Requiring all status checks to pass before merging ensures that:
- Only validated code enters protected branches
- Security and quality gates are consistently enforced
- Repositories comply with organizational review and testing policies
Without this control, developers could merge untested or failing code, introducing regressions or vulnerabilities into production.
What this check does
This check verifies that for each protected branch:
- The “Require status checks to pass before merging” option is enabled.
- All configured status checks (such as GitHub Actions workflows or third-party CI jobs) are required and passing.
If the branch protection rule does not enforce required status checks, or if some checks are optional, the Auto Check will fail or report “Unable to verify.”
How to fix it
From the GitHub Web Console
- Go to your repository on GitHub.
- Navigate to Settings → Branches.
- Under Branch protection rules, click Add rule or edit an existing one.
- In the Require status checks to pass before merging section, check Require status checks to pass before merging.
- Select the specific checks that must pass (e.g., build, test, lint, security scan).
- Optionally, enable Require branches to be up to date before merging to ensure the base branch is current.
- Click Save changes.
Once configured, pull requests cannot be merged until all required checks pass successfully.
Exceptions
- Admins can override this restriction unless “Include administrators” is enabled.
- Status checks must be triggered by a workflow (such as GitHub Actions) or third-party CI provider integrated with the repository.
- If a check name changes (e.g., due to CI configuration updates), it must be reselected in the protection rule.