Action: a run with no report passes on exit 0; baseline name is not URL-encoded
Maintainer antworten meist innerhalb von 1 Tag
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 2/5
- Geschätzter Aufwand
- 1-3 Stunden
- Anfängerfreundlichkeit
- 82/100
Rechercherichtung
Lies die Shell-Schritte in action.yml bei der Prüfung auf fehlende Berichte und der Suche nach Artefakten und sieh dir dann die Fälle des action-Jobs in .github/workflows/go.yml an. Reproduziere den Fall mit fehlendem Bericht mit args: -dry-run und prüfe, wie nach einem Namen gesucht wird, der + oder & enthält. Fertig, wenn beide Akzeptanzkriterien erfüllt sind und CI beide Fälle abdeckt.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
Summary
Two small edge cases in the Action's shell steps:
- A run that writes no report succeeds when subenum exited 0.
- A
baseline-artifactname that contains&,+or#is never found again.
Where
action.yml:243(no-report check),action.yml:54-61(fail-oninput doc)action.yml:174-180(artifact lookup query)
Details
No report, exit 0. After the scan the step runs:
if [ ! -s "$out/run.json" ]; then echo "::error::subenum exited $code without a report"; exit "$code"; fi
code is 0 when subenum exited 0. subenum does that without writing -stats for -dry-run (internal/cli/session.go:114-116) and for -version (session.go:213-216). The step logs an error annotation and then succeeds, although the fail-on doc says "a run with no report always fail[s]". The CI case for a missing report (go.yml:248-261) only covers a non-zero exit.
Artifact name not URL-encoded. The name is put into the query string as is:
gh api "repos/$GITHUB_REPOSITORY/actions/artifacts?name=$NAME&per_page=1"
upload-artifact allows &, +, # and % in names, and the Save step uploads under the raw name. With baseline-artifact: recon+prod the query asks for recon prod; with a&b it asks for a. No artifact matches, and the step prints "this run sets it" on every run.
Impact
- With
-dry-runor-versioninargs, the step is green but itsverdict,foundandresultsoutputs are empty, so a later step gating onverdictsees an empty string instead of a failure. - With such an artifact name, a baseline is uploaded on every run but never downloaded: there is no diff, no
changesoutput, and a time-boxed scan is never resumed. None of this produces an error.
Steps to reproduce
uses: ./withdomain: lab.exampleandargs: -simulate -dry-run. The step succeeds after logging::error::subenum exited 0 without a report.- Use the Action in two separate runs with
baseline-artifact: subenum+prod. The second run logs "No baseline artifact named subenum+prod yet".
Suggested fix
- Exit non-zero when the report is missing:
exit $(( code == 0 ? 1 : code )). - URL-encode the name (
enc=$(jq -rn --arg n "$NAME" '$n|@uri')), or validatebaseline-artifactagainst^[A-Za-z0-9._-]+$up front and fail with a clear message.
Acceptance criteria
-
args: -dry-runfails the step - A
baseline-artifactname with+or&round-trips, or is rejected with a clear error - CI cases in the
actionjob for both
Getting started
- Relevant files:
action.yml,.github/workflows/go.yml(actionjob) - Related: #363
Filed by repo-audit/full-audit at dd5b156. Severity: low. Effort: S. audit-key: bug|action.yml|scan-no-report-exit
- Vorherrschende Sprache
- Go
- Sterne
- 1
- Forks
- 1
- Ø Merge
- 7 Std. 18 Min.
- Gemergte PRs (30 T.)
- 23
Entwicklungsumgebung
Startet den Dev-Container des Projekts im Browser, mit Ihrem eigenen GitHub-Konto.
- Enthält ein Dockerfile oder eine Docker-Compose-Datei
- Hat eine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus TMHSDigital/subenum
-
severity: low tech-debt
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
TMHSDigital/subenum#414 ·
Maintainer antworten meist innerhalb von 1 Tag
-
area: tui good first issue severity: low testing
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 82/100
TMHSDigital/subenum#413 ·
Maintainer antworten meist innerhalb von 1 Tag
-
good first issue severity: low testing
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 85/100
TMHSDigital/subenum#412 ·
Maintainer antworten meist innerhalb von 1 Tag
-
good first issue performance severity: low
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 82/100
TMHSDigital/subenum#411 ·
Maintainer antworten meist innerhalb von 1 Tag
-
area: cli severity: medium tech-debt
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 75/100
TMHSDigital/subenum#402 ·
Maintainer antworten meist innerhalb von 1 Tag
Alle Issues in TMHSDigital/subenum
Ähnliche Issues
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 74/100
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 75/100
trufflesecurity/trufflehog#5573 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Type/Improvement
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 67/100
OpenNSW/nsw-srilanka#1259 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 66/100
katzenpost/katzenpost#1287 ·
Maintainer antworten meist innerhalb von 2 Tagen
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 74/100
Tencent/LoopForge#986 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag