ci: add CodeQL advanced setup to scan pull requests before merge#5250
Draft
nopoz wants to merge 1 commit into
Draft
ci: add CodeQL advanced setup to scan pull requests before merge#5250nopoz wants to merge 1 commit into
nopoz wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Moves CodeQL from GitHub's default setup to advanced setup by adding
.github/workflows/codeql.yml. Default setup only scans pushes and same-repo branches, so it never scans pull requests from forks, which is where nearly all contributor PRs come from. Today that means CodeQL findings only appear after a change is merged intodev, and the fix lands on maintainers rather than the author. This workflow runs CodeQL on pull requests targetingdev(and on pushes todevandmain), so findings surface on the PR before merge. The check is advisory and does not block merges.The languages (
actions,javascript-typescript,python) and the default query suite match what default setup runs today, so the alert set does not change. Actions are pinned to the same SHAs already used elsewhere in this repo.Draft on purpose. Advanced setup and default setup cannot run at the same time: while default setup is enabled, this workflow runs but its upload is rejected, so its CodeQL check will show red until a repo admin disables default setup in the repo settings. Keep this as a draft until that switch is made, then it can be marked ready and merged.
Linked Issue
Fixes #5249
Type of Change
Checklist
.github/workflows, so no screenshot applies.How to Test
Verified end to end on a fork before opening this. To reproduce after default setup is disabled:
devthat adds a known-bad pattern, for example an inefficient regex likere.compile(r"^(a+)+$").actions,javascript-typescript,python) run on the PR.On the fork test, a deliberate
py/redosin a fork PR was flagged on the PR itself, before merge.