Skip to content

ci(codeql): switch to advanced setup so fork pull requests get scanned - #53

Merged
tybot02 merged 1 commit into
mainfrom
ci/codeql-advanced-setup
Aug 22, 2026
Merged

tybot02 merged 1 commit into
mainfrom
ci/codeql-advanced-setup

Conversation

@lucasmaan

Copy link
Copy Markdown
Contributor

Problem

Merging #50 is blocked on Code scanning is waiting for results from CodeQL for the commits ae58a4d or d0b2f35 — and those results were never going to arrive.

CodeQL was on default setup, which does not trigger on pull requests from forks. The evidence:

Check Result
code-scanning/analyses?ref=refs/pull/50/head []
code-scanning/analyses?ref=refs/pull/50/merge []
check-runs on d0b2f35 (head) 5, all green, no CodeQL
check-runs on ae58a4d (= merge_commit_sha) 0
actions/runs?event=dynamic a PR #NN CodeQL run for #32 through #51none for #50

#50 and #52 are the only cross-repository pull requests in that range, and they are exactly the two with no CodeQL run. This is not the outside-contributor approval gate: #52's Tests and Docker runs do sit in the action_required queue, but no CodeQL run is queued there at all — the run is never created.

Since the main ruleset has a code_scanning rule requiring a CodeQL result, every fork pull request is permanently unmergeable.

Fix

Advanced setup. A workflow file is part of the pull request's merge commit, so it runs for fork pull requests too, after the usual approval for outside contributors.

Verified empirically rather than from documentation: prettier/prettier uses advanced setup with a pull_request trigger, and its fork pull requests (e.g. #19908, #19907) each carry a CodeQL check reporting No new alerts in code changed by this pull request — the check produced by a successful SARIF upload, which is what the ruleset consumes.

The matrix reproduces default setup's four analyses and their build modes (actions, go via autobuild, javascript-typescript, python), so language coverage is unchanged. Default setup's language list also named javascript and typescript, which CodeQL folds into javascript-typescript.

Default setup is already disabled

It had to be, and before this branch was pushed: while both configurations are active the upload fails with CodeQL analyses from advanced configurations cannot be processed when the default setup is enabled, which codeql-action raises as a ConfigurationError (src/upload-lib.ts), failing the job. Landing the workflow first would have deadlocked on its own pull request.

The repository had 0 open code scanning alerts at the time of the switch, so nothing active was lost. Re-enabling is one API call if this needs to be reverted.

After this lands

#50 and #52 need a new pull_request event to pick up the workflow — a rebase or a close/reopen — and their runs then need the outside-contributor approval.

GitHub's code scanning default setup never triggers on a pull request from a
fork. Pull request #50, from wangdahoo/kaas, therefore sat permanently blocked:
the "main" ruleset requires a CodeQL result, and no CodeQL run was ever created
for its head or its merge commit. Every same-repo pull request from #32 to #51
got one; both fork pull requests got none.

A workflow file is part of the pull request's merge commit, so it also runs for
fork pull requests, subject to the usual approval for outside contributors. The
matrix reproduces the four analyses and build modes default setup ran, so the
languages covered do not change.

Default setup has to be turned off for this to work: while both are active the
upload fails with "CodeQL analyses from advanced configurations cannot be
processed when the default setup is enabled".
@tybot02
tybot02 merged commit 253e25d into main Aug 22, 2026
10 checks passed
@tybot02
tybot02 deleted the ci/codeql-advanced-setup branch August 22, 2026 15:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants