Skip to content

Code scanning merge protection blocks PRs forever when CodeQL workflows use path filters #4330

Backlog

Description

@dbouclier

What happens

We run one CodeQL workflow per language, each with on.pull_request.paths (or paths-ignore), so a PR only scans the languages it touches. The default branch is scanned on push and on a weekly schedule, so it has results for all 4 categories (/language:actions, /language:java-kotlin, /language:javascript-typescript, /language:go).

  1. The CodeQL check. On a PR that only touches TypeScript, the check concludes neutral with: "Code scanning cannot determine the alerts introduced by this pull request, because 3 configurations present on refs/heads/main were not found". So no alerts are compared or annotated on the PR at all.
  2. Merge protection. With a ruleset code_scanning rule (CodeQL, security_alerts_threshold: high_or_higher), the same PR is blocked: "Code scanning is still expecting 3 results from CodeQL for <merge sha> or <head sha>". Those results never come, because the other workflows are not triggered for that PR.

Expected

A configuration whose workflow was not triggered by the PR (path filter) should count as unchanged from the base branch, not as missing. At minimum, the comparison should use the configurations the PR did produce. Today path filters and merge protection cannot be used together.

Workarounds we know of

  • Remove the path filters and scan every language on every PR. For a frontend-only PR, that costs us an 11-minute Java scan.
  • Our own gate: query the alerts on refs/pull/N/merge, keep the ones with no instance on the base branch, and fail a job that is a required check.

Setup

Advanced setup, github/codeql-action@v4.39.3, security-extended query suite, CodeQL 2.27.4.

This may belong to the code scanning backend rather than the action: please transfer or redirect if so.

Activity

  1. jketema commented on Nov 19, 2026

    @jketema

    Hi @dbouclier,

    Thanks for you report. This is a known limitation. If you're a paying GitHub customer, I'd recommend also flagging this up through your GitHub account manager, so you're interest in getting this resolved gets registered.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions