Compare commits

...

1 Commits

Author SHA1 Message Date
Molecule AI Dev Engineer A (Kimi) 37f05fdd97 fix(codeql): add SARIF upload step for GitHub Security tab (#1044)
sop-checklist / na-declarations (pull_request) N/A: (none)
audit-force-merge / audit (pull_request) Waiting to run
Block internal-flavored paths / Block forbidden paths (pull_request) Waiting to run
branch-protection drift check / Branch protection drift (pull_request) Waiting to run
cascade-list-drift-gate / check (pull_request) Waiting to run
Check merge_group trigger on required workflows / Required workflows have merge_group trigger (pull_request) Waiting to run
Check migration collisions / Migration version collision check (pull_request) Waiting to run
CodeQL / Analyze (${{ matrix.language }}) (go) (pull_request) Waiting to run
CodeQL / Analyze (${{ matrix.language }}) (javascript-typescript) (pull_request) Waiting to run
CodeQL / Analyze (${{ matrix.language }}) (python) (pull_request) Waiting to run
Lint curl status-code capture / Scan workflows for curl status-capture pollution (pull_request) Waiting to run
Runtime Pin Compatibility / PyPI-latest install + import smoke (pull_request) Waiting to run
Secret scan / Scan diff for credential-shaped strings (pull_request) Waiting to run
Ops Scripts Tests / Ops scripts (unittest) (pull_request) Waiting to run
gate-check-v3 / gate-check (pull_request) Waiting to run
qa-review / approved (pull_request) Waiting to run
security-review / approved (pull_request) Waiting to run
sop-checklist / all-items-acked (pull_request) Waiting to run
sop-checklist / review-refire (pull_request) Waiting to run
sop-tier-check / tier-check (pull_request) Waiting to run
Handlers Postgres Integration / Handlers Postgres Integration (pull_request) Has been cancelled
E2E API Smoke Test / E2E API Smoke Test (pull_request) Has been cancelled
E2E Staging Canvas (Playwright) / Canvas tabs E2E (pull_request) Has been cancelled
Harness Replays / Harness Replays (pull_request) Has been cancelled
Runtime PR-Built Compatibility / PR-built wheel + import smoke (pull_request) Has been cancelled
Handlers Postgres Integration / detect-changes (pull_request) Has been cancelled
CI / Shellcheck (E2E scripts) (pull_request) Has been cancelled
CI / Platform (Go) (pull_request) Has been cancelled
CI / Canvas (Next.js) (pull_request) Has been cancelled
CI / Canvas Deploy Reminder (pull_request) Has been cancelled
CI / Python Lint & Test (pull_request) Has been cancelled
CI / Detect changes (pull_request) Has been cancelled
E2E API Smoke Test / detect-changes (pull_request) Has been cancelled
E2E Staging Canvas (Playwright) / detect-changes (pull_request) Has been cancelled
Harness Replays / detect-changes (pull_request) Has been cancelled
Runtime PR-Built Compatibility / detect-changes (pull_request) Has been cancelled
- Add github/codeql-action/upload-sarif@v3 step after analysis
- Grant security-events: write permission for upload API
- Update workflow comments to reflect public-repo free scanning
- SARIF path matches existing analyze output: sarif-results/<lang>/

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-31 23:40:40 +00:00
+17 -7
View File
@@ -8,10 +8,10 @@ name: CodeQL
# scanned. This workflow fills that gap by explicitly scanning both
# branches on push and PR.
#
# Runs on ubuntu-latest (GHA-hosted — public repo, free). GHAS is NOT
# enabled on this repo, so results are not uploaded to the Security
# tab — the scan fails the PR check on findings, and the SARIF is
# kept as a workflow artifact for triage.
# Runs on ubuntu-latest (GHA-hosted — public repo, free). SARIF is
# uploaded to the Security tab via upload-sarif, and also kept as a
# workflow artifact for triage. The scan still fails the PR check on
# findings.
on:
push:
@@ -38,7 +38,7 @@ concurrency:
permissions:
actions: read
contents: read
# No security-events: write — we don't call the upload API.
security-events: write
jobs:
analyze:
@@ -84,11 +84,21 @@ jobs:
uses: github/codeql-action/analyze@95e58e9a2cdfd71adc6e0353d5c52f41a045d225 # v4.35.2
with:
category: "/language:${{ matrix.language }}"
# upload: never — GHAS isn't enabled on this repo, so the
# upload API 403s. Write SARIF locally instead.
# upload: never — we use a separate upload-sarif step so the
# upload runs even when findings fail the job.
upload: never
output: sarif-results/${{ matrix.language }}
- name: Upload SARIF to GitHub Security tab
# Uploads SARIF to the code scanning API so findings appear in
# the Security tab (requires GHAS or public repo). Runs before
# parse so the upload succeeds even when findings fail the job.
if: always()
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: sarif-results/${{ matrix.language }}/
category: codeql-${{ matrix.language }}
- name: Parse SARIF + fail on findings
# The analyze step writes <database>.sarif into the output
# directory — database name is the short CodeQL lang id, not