The Action uploads every SARIF under one fixed category

未關閉
#197 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

維護者通常 1 天內回覆

還沒有人認領這個 Issue。

評估

難度
3/5
預估耗時
1-2 天
新手友好度
78/100
Issue 類型
缺陷
描述清晰度
描述清楚
活躍度
活躍
技術堆疊
github-actions, go
領域
ci-cd, security

研究方向

Start with the SARIF upload and report directory references in action.yml:215, action.yml:268, and action.yml:273, then read docs/ci.md:44 and .github/workflows/action.yml for the action’s documented inputs and workflow coverage. Run make test-short and make lint as listed in the issue. Done means separate uses preserve both alert sets, a later use cannot reuse an earlier use’s reports, and docs/ci.md describes the new input.

由索引模型根據 Issue 內容生成。

描述

bug good first issue severity: low

Summary

The upload step always passes category: spackle and the report directory is fixed, so a workflow that uses the action more than once for one commit ends with the alerts of only the last upload.

Where

  • action.yml:273 (category: spackle)
  • action.yml:215 (out="${RUNNER_TEMP}/spackle-report")
  • action.yml:268
  • docs/ci.md:44

Details

Code scanning keeps one analysis per tool, category, ref and commit, so a second upload with the same category replaces the first (documented GitHub behavior; not exercised during the audit). The path input and the SARIF repository-prefix handling show that scanning a subdirectory is a supported use.

Impact

A monorepo workflow with two path values, a matrix over services, or a deterministic plus a model run closes the alerts of the earlier scans as fixed. Within one job, the second use also finds the first use's report.sarif and report.json in the shared directory, so if the second scan is refused before it writes reports, the outputs are those of the first scan.

Suggested fix

Add a sarif-category input that defaults to spackle when path is . and to spackle-<path> otherwise, pass it to the upload step, and document it in docs/ci.md. Make the report directory unique per invocation (mktemp -d "${RUNNER_TEMP}/spackle-report.XXXXXX").

Acceptance criteria

  • Two uses of the action in one workflow keep both sets of alerts
  • A second use in one job never reads the first use's reports
  • docs/ci.md documents the input

Related: #7

Getting started

  • Relevant files: action.yml, docs/ci.md, .github/workflows/action.yml
  • How to run tests: make test-short (Unix) or .\make.ps1 test-short (Windows PowerShell); make lint before you call it done
  • Related docs: docs/ci.md

Filed by repo-audit/full-audit at 50e92ec. Severity: low. Effort: S. audit-key: bug|action.yml|upload-sarif.category

主要語言
Go
星號
0
分支
1
平均合併
8 小時 14 分鐘
30 天內合併 PR
3

環境準備

在 Codespaces 中開啟

在瀏覽器裡用你自己的 GitHub 帳號啟動這個專案的開發容器。

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

TMHSDigital/Spackle 的其他 Issue

查看 TMHSDigital/Spackle 的全部 Issue

相似的 Issue

更多 Go Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。