feat(sarif): add sarif input + upload-sarif step#1
Merged
Merged
Conversation
- action.yml: new optional `sarif` input (default false). When true: run
`skil-lock ci --format sarif` to ${RUNNER_TEMP}/skil-lock.sarif, then
upload via github/codeql-action/upload-sarif@v4 (category: skil-lock).
- README + MARKETPLACE: document the new input, the security-events:write
permission, and the install snippets bump to v0.1.1.
Pairs with skills-lock/skil-lock PR #9 (v0.1.1 binary).
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
skil-lock
added a commit
that referenced
this pull request
May 22, 2026
…nts (#2) `gh api -f body=@$BODY` was being interpreted as a string literal, not a curl-style file reference — gh CLI does not support `@file` in -f arguments. As a result, every live PR comment posted by the Action since v0.1.0 contained the verbatim text `@/home/runner/work/_temp/skil-lock-pr-comment.md` instead of the capability-delta markdown. The bug was latent because the only CI exercise of this step (`composite-smoke`) runs on `push`, so the `if: github.event_name == 'pull_request'` guard skipped it — the path was never executed until the live SARIF verification PR on `skills-lock/example-claude-code-skills#1` (2026-05-22). Fix: round-trip the file contents through `jq -Rs '{body: .}'` to produce a safe JSON payload, then pipe it to `gh api --input -`. `jq -Rs` handles arbitrary text (newlines, quotes, backticks, unicode) without shell-escaping pitfalls. `jq` is preinstalled on `ubuntu-latest` and `macos-latest` runners, which are the only platforms the composite supports. Verified against PR #1 of example-claude-code-skills on the fix branch after this commit lands.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
sarifinput on the composite action (defaultfalse). Whentrue, runsskil-lock ci --format sarifto${RUNNER_TEMP}/skil-lock.sarifand uploads viagithub/codeql-action/upload-sarif@v4withcategory: skil-lock.security-events: writepermission.v0.1.1(binary + Action).Pairs with
skills-lock/skil-lock#9(already merged + taggedv0.1.1).Test plan
yaml-lintworkflow validatesaction.ymlcomposite-smoketestdata still pinsv0.1.0so this PR's CI exercises the unchanged happy pathv0.1.1tag, switch testdata tov0.1.1+ add a SARIF smoke step (follow-up commit)sarif: trueto verify the upload step posts to Code Scanning🤖 Generated with Claude Code