The Action uploads every SARIF under one fixed category

Aperta
#197 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
78/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
github-actions, go
Ambito
ci-cd, security

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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

Lingua principale
Go
Stelle
0
Fork
1
Merge medio
8h 14m
PR unite (30g)
3

Preparare l'ambiente

Apri in Codespaces

Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di TMHSDigital/Spackle

Tutte le issue di TMHSDigital/Spackle

Issue simili

Altre issue su Go

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.