-
Notifications
You must be signed in to change notification settings - Fork 0
Add SARIF output for GitHub Code Scanning integration #4
Copy link
Copy link
Open
Labels
enhancementNew feature or requestNew feature or requesthelp wantedExtra attention is neededExtra attention is needed
Description
Context
pulser has a GitHub Action (action.yml) but diagnostics only appear in the log. If we output SARIF format, GitHub will show issues as inline annotations directly on PR diffs — like ESLint and CodeQL do.
What is SARIF
SARIF 2.1.0 is the standard format for static analysis results. GitHub Code Scanning natively supports it.
What to do
- Add
"sarif"to theOutputFormatunion type insrc/types.ts - Add a
reportSarif()function insrc/reporter.tsthat mapsDiagnostic[]→ SARIF schema - Update
action.ymlto upload the SARIF file viagithub/codeql-action/upload-sarif
Example SARIF output
{
"$schema": "https://raw.githubusercontent.com/oasis-tcs/sarif-spec/main/sarif-2.1/schema/sarif-schema-2.1.0.json",
"version": "2.1.0",
"runs": [{
"tool": { "driver": { "name": "pulser", "version": "1.0.0" } },
"results": [{
"ruleId": "gotchas",
"level": "error",
"message": { "text": "Missing Gotchas section" },
"locations": [{ "physicalLocation": { "artifactLocation": { "uri": ".claude/skills/my-skill/SKILL.md" } } }]
}]
}]
}Files to modify
src/types.ts(OutputFormat)src/reporter.ts(new function)src/index.ts(format validation)action.yml(SARIF upload step)
Difficulty: Medium
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requesthelp wantedExtra attention is neededExtra attention is needed