Skip to content

ci: replace CodeQL default setup with advanced setup for fork PRs - #5507

Merged
svozza merged 1 commit into
mainfrom
issue-5506-codeql-advanced-setup
Jul 27, 2026
Merged

svozza merged 1 commit into
mainfrom
issue-5506-codeql-advanced-setup

Conversation

@svozza

@svozza svozza commented Jul 27, 2026 •

Copy link
Copy Markdown
Contributor

Summary

CodeQL was configured via GitHub-managed default setup, which only analyzes branches in the base repository — so PRs from forks were permanently blocked by the required CodeQL status check, which sat in "Expected — waiting for status to be reported" forever. This replaces default setup with a checked-in advanced-setup workflow that also runs on pull_request, so fork PRs are analyzed and can satisfy the required check.

Changes

  • Added .github/workflows/codeql.yml (advanced setup) triggering on push to main, pull_request to main, and a weekly schedule
  • Mirrored the previous default-setup configuration: languages actions and javascript-typescript, default query suite, remote threat model, weekly cadence
  • Verified against the sibling .NET repo (same setup) that the CodeQL check reported by the GitHub Advanced Security app — the exact context required on main — is still produced, so branch protection needs no change
  • All actions are SHA-pinned (satisfies the repo's secure-workflows.yml gate); actionlint passes
  • Fork-PR runs remain gated behind the repository's external-contributor Actions approval policy, preserving the security gate — a maintainer still approves before CodeQL runs against a fork's code

Note: CodeQL default setup has already been disabled (repo Settings → Code security → Code scanning), because advanced and default setup can't both be active — with default setup on, the advanced workflow's SARIF upload is rejected and the required CodeQL check can't pass. This PR's own CodeQL check is now green, produced by this workflow. Until this PR merges, main itself has no CodeQL scanning (the workflow only takes effect on main once merged), so merging promptly closes that gap.

Issue number: closes #5506


By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Disclaimer: We value your time and bandwidth. As such, any pull requests created on non-triaged issues might not be successful.

CodeQL was configured via GitHub-managed default setup, whose analysis
only runs for branches in the base repository. Since the `CodeQL`
status check is required on `main`, pull requests from forks were
permanently blocked: the check sat in "Expected — waiting for status to
be reported" and could never be satisfied.

Add a checked-in advanced-setup workflow that also runs on pull_request,
so fork PRs are analyzed and can report the required `CodeQL` check. The
languages (actions, javascript-typescript), default query suite, remote
threat model, and weekly schedule mirror the previous default setup.
Fork-PR runs remain gated behind the repository's external-contributor
Actions approval policy, so a maintainer still approves before CodeQL
runs against a fork's code.

Closes #5506
Comment thread .github/workflows/codeql.yml Resolved
@svozza
svozza merged commit 1781bfe into main Jul 27, 2026
43 of 45 checks passed
@svozza
svozza deleted the issue-5506-codeql-advanced-setup branch July 27, 2026 20:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/M PR between 30-99 LOC

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Maintenance: Switch CodeQL from default setup to advanced setup so fork PRs get analyzed

2 participants