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 摘要。