#132
feat(export): add SARIF 2.1.0 export format for GitHub Code Scanning
Add --format sarif to the export command, producing SARIF 2.1.0 compliant output that can be uploaded to GitHub Code Scanning via github/codeql-action/upload-sarif@v4.
Closes #40
What
- New
buildSarifLog()andwriteSarif()inexport.ts - Severity mapping: CRITICAL/HIGH → error, HIGH_BUG/MEDIUM → warning, BUG/LOW → note
vulnSlug→ SARIFruleId; rules deduped per run- Each project → one SARIF
run - Custom properties preserve original severity, confidence, revalidation verdict
- Stable
partialFingerprints.primaryLocationLineHashfor cross-run tracking
Why
Enables deepsec findings to be displayed as PR annotations and in the repository Security tab, integrating with GitHub's native code scanning workflow.
Testing
- 18 unit tests in
export-sarif.test.tscovering structure, severity mapping, rule dedup, locations, fingerprints, properties, multi-project - E2E test in
pipeline.test.tsvalidates the full pipeline produces valid SARIF - Validated against official SARIF 2.1.0 JSON schema (ajv)
- Validated end-to-end: SARIF uploaded to GitHub Code Scanning via
upload-sarif@v4action, all 10 findings accepted successfully
What changed
Why
Verification
-
pnpm testpasses -
pnpm lintpasses -
pnpm knippasses - If this adds a matcher: ran it against at least one real repo and confirmed the candidate count is sane
Notes for reviewer
Activity
5vercel[bot]reviewed3mo ago
vercel[bot]reviewed3mo ago
@pmlpl is attempting to deploy a commit to the Vercel Labs Team on Vercel.
A member of the Team first needs to authorize it.