Skip to main content

Resolving a block on your pull request

Identify and resolve a code quality or coverage threshold block on your pull request so you can merge your changes.

Who can use this feature?

Users with write access

Note

GitHub Code Quality is currently in public preview and will become generally available on July 20, 2026. During public preview, Code Quality will not be billed, although Code Quality scans will consume GitHub Actions minutes. From July 20, 2026, usage will incur charges. See GitHub Code Quality billing.

Understanding why your pull request is blocked

Repository administrators can set quality gates using GitHub Code Quality. When you open a pull request, checks automatically run to evaluate your changes against these standards.

There are two types of blocks:

  • Code quality findings: your changes introduce issues that fall below the required quality threshold.
  • Coverage threshold: your changes cause code coverage to fall below a required minimum, or cause coverage to drop by more than a permitted amount relative to the default branch.

If your pull request introduces code that falls below the required quality threshold, you'll see a merge block banner at the bottom of the pull request in the "Checks" section: "Merging is blocked: Code quality findings were detected."

Screenshot of the merge block banner in the Checks section of a pull request.

These checks help maintain a healthy, maintainable codebase and prevent technical debt from accumulating.

Viewing scan results and their severity levels

The results of the scan are reported as comments on your pull request, left by the github-code-quality[bot]. Each comment corresponds to a specific code quality problem that was detected in your changes.

Comments are labeled by severity (Error, Warning, Note). To learn more about what the severity levels mean, see Severity levels.

Determining which findings are blocking your pull request

The quality gate set by repository administrators defines the minimum severity level that will block merging.

The merge block banner may specify the minimum severity level. All findings at that severity level or higher must be addressed before you can merge your pull request.

Screenshot of the merge block banner in the Checks section of a pull request.

Note

If you don't see a severity level defined in the merge block banner, it means that your repository is using the most stringent code quality thresholds, which require all findings to be addressed before merging.

Fixing or dismissing each finding

In order to unblock your pull request, you need to resolve each required finding by deciding whether to fix the issue in your code or dismiss the comment.

Leveraging Copilot Autofix and Copilot cloud agent to fix findings

Copilot Autofix

Comments on the pull request include a suggested autofix that you can commit directly to your pull request. Carefully review the suggested autofix for logic, security, and style, then click Commit suggestion.

You don't need a Copilot license to apply these suggestions.

Copilot cloud agent

Alternatively, if you have a Copilot license, you can delegate the remediation work to Copilot cloud agent. Comment on the pull request mentioning @Copilot and request that Copilot fix the detected issues.

Screenshot showing a PR comment that invoked Copilot cloud agent.

Copilot responds with an eyes emoji (đź‘€) to your comment, starts a new agent session, and opens a pull request with the necessary fixes.

You can track Copilot cloud agent's work:

You need a Copilot license to invoke Copilot cloud agent.
Sign up for Copilot

Dismissing the finding

You can dismiss a finding if it isn’t relevant or actionable in the context of your codebase. Common reasons to dismiss a finding include:

  • The finding is in legacy code that’s no longer maintained.
  • It’s a known exception to your team’s coding standards.
  • It’s a false positive that doesn’t pose a real quality risk.

Dismissing irrelevant alerts keeps your quality checks focused on meaningful issues.

Verifying that you've met the requirements

To see if you've met the code quality requirements, look at the "Checks" section at the bottom of your pull request. The merge block banner should no longer be present, and you should be able to merge your changes as usual.

Resolving a coverage threshold block

If your pull request is blocked by a coverage threshold rule, you'll see a merge block banner in the "Checks" section with a message describing which threshold was not met. For example:

  • "Coverage 22.0% is below minimum 50.0%": your pull request branch coverage is below the minimum coverage percentage configured in the ruleset.
  • "Coverage decreased by 2.5%, maximum allowed drop is 1.0%": your changes caused coverage to drop by more than the permitted amount relative to the default branch.

To unblock your pull request, you need to add or modify tests so that more of the codebase is executed:

  1. Review the coverage summary comment on your pull request to identify which files or areas lack coverage.
  2. Add or update tests to increase execution coverage.
  3. Push your changes. The coverage check will re-run automatically.

Next steps

Reduce technical debt by fixing findings in recently changed files. See Improving the quality of recently merged code with AI.