Skip to content

feat(action): fail-on-scan-error input; never report a stale SBOM - #139

Merged
lab700xdev merged 1 commit into
mainfrom
action-fail-on-scan-error
Nov 15, 2026
Merged

lab700xdev merged 1 commit into
mainfrom
action-fail-on-scan-error

Conversation

@lab700xdev

Copy link
Copy Markdown
Contributor

What

  • New fail-on-scan-error input (default false). When aisbom scan exits 1 (a directory that doesn't exist, a file it couldn't parse, an unreadable model file such as a git-LFS pointer stub), the job used to pass with nothing said. It now adds a warning annotation, and fails the job with exit 1 when the input is true. Any exit other than 0 and 2 counts. The default becomes true at the next major release.
  • No stale SBOM. The Action deletes its output file and the matching *.openvex.json / *.vex.cdx.json before scanning. A scan that writes nothing produces no PR comment and no upload. Nothing else in the workspace is touched.
  • Exit precedence: 2, then 1, then 3. The upload still runs before every gate.
  • An older action.yml that passes ten args keeps today's behaviour ($11 defaults to false).

Tests

  • tests/test_action_entrypoint.py: the aisbom stub now writes --output only when the test says the scan produced it, so a stale file and a fresh one are distinct. 20 new tests cover stale-file removal (SBOM, VEX, custom paths, unrelated files kept) and the new input (default warning, opt-in failure, exact-true only, crash exits, precedence against exit 2 and 3).
  • Full suite: 1849 passed, coverage 94.7%. shellcheck action/entrypoint.sh clean.
  • The real CLI on .pt and .safetensors LFS pointer stubs exits 1 and still writes an SBOM.
  • An end-to-end run of the Action against a committed LFS stub follows before merge.

Docs: action.yml, action/README_ACTION.md (input row, quick-start step, troubleshooting entry), CHANGELOG.

A scan that exits 1 (a missing directory, a parse error, an unreadable
model file such as a git-LFS pointer stub) used to end the Action job
green with nothing said. It now adds a warning annotation, and fails the
job with exit 1 when `fail-on-scan-error: true`. The default stays false
and becomes true at the next major release.

The Action now deletes its output file and the matching VEX files before
scanning, so a file left by an earlier step or committed to the repo is
never commented on or uploaded as this run's result.

Exit precedence is 2, then 1, then 3; the upload still runs first.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 15, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-15T16:24:34.133742Z 082e453 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@lab700xdev
lab700xdev merged commit 78039f6 into main Nov 15, 2026
2 checks passed
@lab700xdev
lab700xdev deleted the action-fail-on-scan-error branch November 15, 2026 19:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant