ci: gate CodeQL analysis at the job level for docs-only PRs#40724
Conversation
CodeQL gated only its final analyze step on the change-detector, so on a docs-only PR both language runners (python, javascript) still spun up, checked out, ran the detector, and initialized CodeQL before skipping the analysis. Move the gate to the job level via the shared `changes` job so those runners don't start at all when no code changed. A job-level skip is deliberately used instead of a `paths-ignore` filter: a skipped required check is treated as passing by branch protection, whereas a path-filtered workflow never reports its check and would block merges if CodeQL is required. push and scheduled runs are unaffected (the detector returns "all changed" for non-PR events). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
Bito Automatic Review Skipped - Files Excluded |
|
The action .github/workflows/codeql-analysis.yml |
zizmor (code scanning) flagged a mismatched hash-pin comment: the pinned SHA de0fac2e... is checkout v6.0.2, but the comment said "# v6" — and the moving v6 tag has since advanced to v6.0.3, so the comment no longer matched the pin. Update both checkout comments in this workflow to the accurate "# v6.0.2". No behavior change (same SHA). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
SUMMARY
CodeQL gated only its final
Perform CodeQL Analysisstep on thechange-detector. On a docs-only PR that meant both language runners
(
python,javascript) still spun up, checked out, ran the detector, and ranInitialize CodeQLbefore skipping the actual analysis.This moves the gate to the job level using the shared lead-
changes-jobpattern (same as #40718 / #40723), so the analysis runners don't start at all
when no code changed:
Why job-level skip instead of
paths-ignore: a skipped required check istreated as passing by branch protection, whereas a
paths-ignored workflownever reports its check at all — which would deadlock merges if CodeQL is a
required check. push and scheduled (nightly) runs are unaffected: the detector
returns "all changed" for non-PR events, so full security coverage is preserved.
TESTING INSTRUCTIONS
Analyze (python)/Analyze (javascript)run as before.ADDITIONAL INFORMATION
🤖 Generated with Claude Code