ci: switch CodeQL to advanced setup so fixture paths can be excluded#28
Merged
Conversation
codeguard's test corpus contains deliberately vulnerable fixtures (testdata/, tests/corpus/**) that its own detection tests consume. CodeQL default setup was flagging those fixtures on every PR and Copilot Autofix suggested changes that would defang the corpus. Default setup does not support path exclusions, so this switches to an advanced-setup workflow whose config ignores the fixture paths. Same languages and weekly cadence as the default setup it replaces. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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
CodeQL default setup (and the code-quality bot) have been flagging codeguard's deliberately vulnerable test fixtures on PRs —
**/testdata/**(e.g.adversarial.ts,html_sink_adversarial.ts) andtests/corpus/**/vulnerable/**— with Copilot Autofix suggesting changes (e.g. replacingdocument.write) that would defang the detection corpus the scanner's own tests depend on (tests/checks/typescript_treesitter_test.go,internal/codeguard/checks/support/treesitter/treesitter_test.go).Default setup does not support path exclusions, so this PR switches the repo to an advanced-setup CodeQL workflow:
.github/workflows/codeql.yml— same languages (actions,go,javascript-typescript) and weekly cadence as the default setup it replaces; actions pinned by SHA to match repo convention..github/codeql/codeql-config.yml—paths-ignorefor**/testdata/**andtests/corpus/**.Default setup has been disabled on the repo so the advanced workflow's uploads are accepted (they conflict otherwise).
Note: the code-quality bot's comments are configured separately (repo Settings → Code quality) — this PR only covers CodeQL.
Test plan
Analyze (…)checks on this PR run via the new workflow and report no findings in fixture paths🤖 Generated with Claude Code