Skip to content

chore(ci): switch CodeQL from default to advanced setup#370

Merged
schmug merged 1 commit into
mainfrom
chore/codeql-advanced-setup
May 24, 2026
Merged

chore(ci): switch CodeQL from default to advanced setup#370
schmug merged 1 commit into
mainfrom
chore/codeql-advanced-setup

Conversation

@schmug
Copy link
Copy Markdown
Owner

@schmug schmug commented May 24, 2026

Summary

  • Adds .github/workflows/codeql.yml (advanced setup) and .github/codeql/codeql-config.yml excluding test/** from analysis.
  • Replaces the repo-Settings default setup so the path-ignore config can be expressed in version control.

Why

The js/incomplete-url-substring-sanitization query has been firing on test assertions like expect(v.message.includes("example.com")).toBe(true) — no URL flow, no fetch, no auth boundary, just .includes() on an asserted output string. Four such alerts (#8, #9, #12, #13) were dismissed as false positives on 2026-05-24; this PR prevents the pattern from re-surfacing on every test edit.

Cutover sequence (read before merging)

  1. Disable default setup in repo Settings → Code security → "Default" → switch off, or via API:
    gh api -X PATCH /repos/schmug/dmarcheck/code-scanning/default-setup -f state=not-configured
    
  2. Merge this PR.
  3. The new workflow runs on push to main and produces two checks named Analyze (actions) and Analyze (javascript-typescript) — matching the previous default-setup job names so no branch-protection update is needed.

If default setup is left enabled when this merges, the advanced workflow will error with "CodeQL analyses from advanced configurations cannot be processed when the default setup is enabled".

What's covered / not covered

  • Languages: actions and javascript-typescript (the latter covers both JS and TS in modern CodeQL — same coverage as before).
  • Triggers: PR + push to main + weekly cron (Mon 12:23 UTC).
  • Excluded: test/** and **/*.test.ts. Source code (including mta-sts-worker/) still analyzed.

Test plan

  • Disable default setup before merging
  • After merge, verify Analyze (actions) and Analyze (javascript-typescript) checks run on main
  • Open a throwaway PR that adds a .includes("example.com") assertion in a test file → confirm no CodeQL alert is raised
  • Confirm CodeQL still raises alerts for issues outside test/**

Adds .github/workflows/codeql.yml plus a config file at
.github/codeql/codeql-config.yml that excludes test/** from analysis.

Motivation: the js/incomplete-url-substring-sanitization rule was firing
on test assertions like expect(v.message.includes("example.com")) — no
URL flow, no fetch, no auth boundary, just a string match on asserted
output. Four such alerts have been dismissed as false positives; the
path-ignore config prevents the pattern from re-surfacing.

Cutover requires disabling default setup in repo Settings -> Code
security before this merges, otherwise advanced setup runs will error.
Job names match the previous "Analyze (<language>)" pattern so any
status-check pinning is preserved.

Actions are SHA-pinned per repo convention; Dependabot
(github-actions ecosystem) will keep them current.
@cloudflare-workers-and-pages
Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
✅ Deployment successful!
View logs
dmarcheck 7627d32 May 24 2026, 01:55 PM

@schmug schmug enabled auto-merge (squash) May 24, 2026 13:55
@schmug schmug merged commit 4566081 into main May 24, 2026
7 checks passed
@schmug schmug deleted the chore/codeql-advanced-setup branch May 24, 2026 13:56
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.

1 participant