GitHub: the merge waits for code quality results
A branch ruleset can require code quality results ("Require code quality results"). If the repository is configured with GitHub Code Quality, a pull request into that branch is then not merged while the analysis is still in progress, when the analysis fails for any reason (for example, the budget for Actions minutes is exhausted), or while Code Quality has found a result at the severity the ruleset defines or higher (GitHub's available rules for rulesets and setting code quality thresholds for pull requests). Classic branch protection has no such setting; it is the ruleset rule code_quality (checked October 26, 2026).
GET /repos/OWNER/REPO/rules/branches/BRANCH
[{ "type": "code_quality", "parameters": { "severity": "warnings" } }]
What the rule checks
- One severity: the ruleset's "Severity" is the lowest severity of code quality results that must be resolved before a pull request can be merged: "Errors" blocks unresolved errors, "Warnings and higher" unresolved warnings or errors, "Notes and higher" unresolved notes, warnings or errors, and "All" any unresolved code quality results. Through the REST API it is
severity(errors,warnings,notes,all), and when the rule is configured, a code quality analysis must be done on the pull request before the changes can be merged (GitHub's REST API endpoints for rules). - The severity in GraphQL: the parameters of a ruleset's
CODE_QUALITYrule areCodeQualityParameters, whoseseverityis the lowest severity level at which code quality reviews need to be resolved before commits can be merged:ERRORS,WARNINGS(Warnings and higher),NOTES(Notes and higher) orALL(GitHub's GraphQL reference, CodeQualityParameters and CodeQualitySeverity). - The labels: every finding carries a severity label. Error is a high-severity issue likely to cause bugs, failures or major maintainability risks; Warning a moderate one that may affect quality or reliability but is not immediately critical; Note a low-severity issue, minor improvement or recommendation (GitHub's preventing code quality issues from reaching your default branch).
- What is analyzed: on pull requests, Code Quality posts rule-based CodeQL findings only, for C#, Go, Java, JavaScript, Python, Ruby and TypeScript; its AI findings cannot be set as a threshold, and the threshold has an effect only if the repository has code in a supported language (GitHub's GitHub Code Quality).
- Coverage is another rule: a minimum line coverage or a maximum coverage drop is the separate "Restrict code coverage" rule, not "Require code quality results".
- Evaluate first: GitHub suggests the enforcement status "Evaluate" while the threshold is calibrated; the ruleset insights then show which pull requests would have been blocked, and "Active" enforces it. "Get rules for a branch" returns all active rules that apply to a branch, at whatever level they are configured, and not the rules of rulesets that only evaluate or are disabled.
- What has to be on: Code Quality is available with GitHub Team or GitHub Enterprise Cloud. An enterprise owner must have allowed it in the enterprise, and GitHub Actions must be enabled, because each CodeQL analysis runs as an action (GitHub's prerequisites). Once it is enabled, an initial scan runs on the default branch (GitHub's scan frequency after enablement).
- The setup through REST:
GET /repos/OWNER/REPO/code-quality/setupreturnsstate(configuredornot-configured), thelanguagesanalyzed,runner_type(standardorlabeled) withrunner_label,scheduleandai_findings_option(disabledoron_push). A 403 means the account is not authorized to access Code quality for the repository (GitHub's get a code quality setup configuration). - Changing the setup through REST:
PATCH /repos/OWNER/REPO/code-quality/setuptakesstate(configuredornot-configured),runner_typeandrunner_label,languages(csharp,go,java-kotlin,javascript-typescript,pythonorruby) andai_findings_option. It answers 200 or 202 Accepted, 403 if the repository is archived or Code quality is not enabled for it, 409 if a setup update is already in progress, and 422 if the change cannot be made (GitHub's update a code quality setup configuration).
To see the code quality rule before you merge: Pull Request Inbox for GitHub, a plugin for JetBrains IDEs, lists the Code Quality check with the others, and when the rulesets require code quality results, its merge checks name the severity of findings that must be fixed or dismissed.
Where it shows on the pull request
- The banner: when the changes fall below the required threshold, the "Checks" section at the bottom of the pull request shows "Merging is blocked: Code quality findings were detected." If the banner does not name a severity level, the repository requires all findings to be addressed (GitHub's resolving a block on your pull request).
- The check: the analysis shows as the "CodeQL - Code Quality / Analyze" check in the "Checks" section. A failure means the workflow failed to run, for example because the budget for Actions minutes is exhausted (GitHub's CodeQL-powered analysis for Code Quality).
- The findings: comments by
github-code-quality[bot]on the Files changed tab, each with its severity label and a suggested autofix. - The workflow: Code Quality and code scanning runs both use the workflow name CodeQL on the Actions tab; Code Quality runs have the actor
github-code-quality, or a run name such as "Code Quality: push on main." - Rules as CodeQL queries: each Code Quality rule is written as a CodeQL query and run using GitHub Actions, and GitHub lists the queries for each supported language (GitHub's query lists for supported languages). Findings for the default branch appear under the "Standard findings" dashboard on the repository's Security and quality tab. If the organization has configured caching of private registries, the analysis can use them to resolve dependencies (workflow used for code quality analysis).
What to do
- Findings at the blocking severity: fix or dismiss every finding at that severity or higher. On the Files changed tab, click "Commit suggestion" (or "Add suggestion to batch") to apply an autofix, or "Dismiss finding" with a reason when it does not apply; a dismissed finding lets you merge, but it appears in the repository's backlog and in future pull requests. If the banner stays, a finding at or above the blocking severity is still open.
- The findings through REST:
GET /repos/OWNER/REPO/code-quality/findingslists the findings of the repository, only open or dismissed ones withstate=openorstate=dismissed, 30 per page by default and up to 100 withper_page, newest first unlessdirection=asc;.../findings/FINDING_NUMBERgets one. A personal access token (classic) needs thereposcope, orpublic_repofor public repositories only (GitHub's list code quality findings for a repository). - Analysis in progress or failed: give the Code Quality check time to finish; if it failed, open its workflow run's logs on the Actions tab. A ruleset that requires results while the workflow does not report on pull requests can block the merging of all of them.
- No Code Quality comments: the scan may still be running, the changes may not touch a supported language, or there are no findings.
- A coverage message instead: "Line coverage 22.0% is below minimum 50.0%" or "Line coverage decreased by 2.5%, maximum allowed drop is 1.0%" is the coverage rule (see a code coverage threshold blocks the merge); add or update tests and push, and the coverage check runs again.
- The analysis keeps failing on minutes: Code Quality scans run as GitHub Actions workflows and consume Actions minutes unless you use self-hosted runners (GitHub's GitHub Code Quality billing). In the repository's Settings, under Code quality, choosing Labeled runner as the Runner type and setting a Runner label sends the analysis to another runner (GitHub's enabling Code Quality for your repository).
- Turning Code Quality off: in the repository's Settings, under Code quality, switching Code Quality analysis from On to Off stops all future scans and the Actions minutes and AI credits they use. Findings, quality scores and history are kept and are there again if it is turned back on, and license charges continue for a period (GitHub's disabling GitHub Code Quality).
- Let Copilot fix them: with a Copilot license, a comment on the pull request that mentions
@Copilotand asks it to fix the detected issues starts Copilot cloud agent: it reacts with an eyes emoji, starts a new agent session and opens a pull request with the fixes (GitHub's delegating remediation work to Copilot).
In IntelliJ IDEA: the analysis by its check run name, and no banner
Checked in the IntelliJ IDEA source on November 2, 2026: checkRun.graphql, checkSuite.graphql, GHPRMergeabilityStateBuilder.kt, CodeReviewDetailsStatusComponentFactory.kt.
For each check run, the IDE asks GitHub for these fields:
fragment checkRun on CheckRun {
name
conclusion
isRequired(pullRequestNumber: $number)
detailsUrl
url
}
The workflow name is not among them, so Details… lists the analysis by its check run name alone, without the "CodeQL - Code Quality /" that GitHub shows in front. While the analysis runs, its check has no conclusion yet and counts as in progress; a failed one counts as failed (GitHub: a check on the pull request was cancelled).
No line in the IDE repeats "Merging is blocked: Code quality findings were detected.", and the IDE does not read the ruleset's severity (GitHub: a code coverage threshold blocks the merge).
GitHub pull requests in IntelliJ IDEA
Pull Request Inbox for GitHub, a plugin by Lesstep for JetBrains IDEs 2024.1 or later, shows a pull request's reviews, checks and conversations next to the diff, and merges it with the methods the target branch allows. When GitHub calls the pull request blocked, its merge checks name what they can read: required checks that have not reported, a review still required, unresolved conversations and unsigned commits the rules hold against it, the rule on the most recent push, and the code scanning tools the rulesets require. Its checks list shows the Code Quality check with the others, and when the branch's rulesets require code quality results, the merge checks of a blocked pull request say so and name the severity of findings that must be fixed or dismissed. The review inbox, diffs and conversations are free; approving, commenting, resolving and merging are Pro (US$1.50 a month, with a 30-day trial).
Get it on JetBrains Marketplace
GitHub is a trademark of GitHub, Inc.; IntelliJ IDEA is a trademark of JetBrains s.r.o. This page is not affiliated with or endorsed by GitHub, Inc. or JetBrains.
More: GitHub merge refused (405, 409) · GitHub review refused (422) · GitHub search 422 "Validation Failed" · "Resource not accessible by personal access token" · 401 "Bad credentials" · "Resource protected by organization SAML enforcement" · "API rate limit exceeded" · GitHub diff 406 "too_large", 3,000 files · GitHub line comment 422 "must be part of the diff" · GitHub branch update refused (422) · GitHub pull request not created (422, 403) · GitHub auto-merge refused · GitHub draft, ready for review or close refused · GitHub conversation not resolved · GitHub checks not shown (check runs 403) · GitHub file contents not read · GitHub compare refused (404, 422) · GitHub comment or reply refused (403 locked, archived) · GitHub merge method not allowed (405) · GitHub branch not found (404, 301) · GitHub Enterprise Server not reached · GitHub review request not shown · GitHub pull request list incomplete · GitHub 404 Not Found, renamed repositories (301, 307) · GitHub line comment outdated or not on the diff · GitHub pull requests not updating, notifications late · GitHub suggested change cannot be applied · GitHub required check stuck at "Expected" · GitHub code owner review required · GitHub merge blocked by unresolved conversations · GitHub merge blocked by unsigned commits · GitHub branch that merges through a merge queue · GitHub merge waiting for an approval of the most recent push · GitHub merge waiting for code scanning results · GitHub merge blocked by a code coverage threshold · GitHub merge blocked by license compliance results · GitHub branch locked or its updates restricted · GitHub branch not deleted after merging · GitHub merge waiting for a team's approval (Required reviewers) · GitHub merge blocked by secret scanning alerts · GitHub stacked pull request not merging · GitHub push blocked by push rules · GitHub merge blocked by commit metadata rules · GitHub force push blocked · GitHub issue not closed by a merged pull request · GitHub pull request not checked out locally · GitHub pull request has merge conflicts · GitHub changes requested and dismissing a review · GitHub co-author not credited for a commit · GitHub dependency review check failed · GitHub Dependabot not rebasing its pull request · GitHub fork not syncing with upstream · GitHub pull request base branch not changing · GitHub pull request not reverting · GitHub pull request template not showing · GitHub pull request labels or assignees not added · GitHub pull request not closing or reopening · GitHub push blocked by push protection · GitHub pull request comment hidden · GitHub pull request blocked until deployments succeed · GitHub team review request replaced by members · GitHub pull request file no longer marked Viewed · GitHub pull request marked merged without being merged · GitHub Copilot review does not count as an approval · GitHub checks not running on a pull request a workflow created · GitHub Update branch button not shown on a pull request · GitHub checks failing on a Dependabot pull request · GitHub checks failing on a pull request from a fork · GitHub checks skipped by [skip ci] in a commit message · GitHub checks gone after the retention period · GitHub code review limits in a public repository · GitHub pull requests turned off or limited in a repository · GitHub checks run on every pull request in a stack · GitHub pull request showing commits already squash merged · GitHub pull request not showing a file diff · GitHub push to a pull request branch from a fork refused · GitHub check cancelled on a pull request · GitHub Rebase and merge not available · GitHub merge commit message not what you expected · GitHub pull request shows every line changed · GitHub API request timed out · GitHub pull request image or document diff not shown · GitHub review request refused (422) · GitHub pull request from Copilot: checks not running, approval not counted · GitHub push refused: GH006 and GH013 on a protected branch · GitHub "At least 1 approving review is required", approvals that do not count · GitHub pull request plugins for IntelliJ IDEA, compared · 日本語