Skip to content

feat(security-container-scan): always produce table alongside JSON/SARIF#47

Merged
lachen-nv merged 1 commit into
mainfrom
feat/grype-always-table
Apr 24, 2026
Merged

feat(security-container-scan): always produce table alongside JSON/SARIF#47
lachen-nv merged 1 commit into
mainfrom
feat/grype-always-table

Conversation

@lachen-nv

Copy link
Copy Markdown
Collaborator

Summary

  • Grype now always emits three formats per scan — JSON, SARIF, and plain-text table — instead of JSON + SARIF only.
  • New report-table input (default grype-results.txt) and matching report_table output.
  • Removes the per-branch generate-table conditional that callers would otherwise need — table is cheap enough (one extra Grype run, ~15-30s; DB cache keeps it fast after the first call) that unconditional is cleaner.

Motivation

PR reviewer feedback on the first rollout: downloading the per-service artifact and then jqing the JSON was not an obvious workflow. A plain-text table lets reviewers download and read directly.

JSON is kept because our aggregator (security-container-scan-aggregate) parses .matches[] from Grype's native JSON; rewriting it to consume SARIF would lose Critical/High granularity without a CVSS-score mapping shim, and would drop Grype-specific fields (fix.versions, relatedVulnerabilities, matchDetails) that future features are likely to want.

Changes

  • .github/actions/security-container-scan/action.yml
    • Add report-table input (default grype-results.txt)
    • Add report_table output
    • Always run the -o table Grype pass (previously absent)
    • Extend upload-artifact path list with the table file; add if-no-files-found: ignore as defence against partial output from a crashed Grype run
  • .github/actions/security-container-scan/README.md
    • Document new input/output
    • Note the three-format guarantee in the Notes section

Test plan

🤖 Generated with Claude Code

Grype now always emits all three formats — JSON for tooling (our own
aggregator parses this), SARIF for GitHub code scanning, and a plain-
text table for humans reviewing the artifact. No opt-in flag: the
extra Grype run is ~15-30s and well worth removing the per-branch
conditional from every caller.

New `report-table` input (default `grype-results.txt`) and matching
`report_table` output. `upload-artifact` bundles all three files;
`if-no-files-found: ignore` defensively tolerates partial output if
Grype fails mid-run.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

@mmou-nv mmou-nv left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

@lachen-nv lachen-nv merged commit 739847d into main Apr 24, 2026
2 checks passed
@github-actions github-actions Bot locked and limited conversation to collaborators Apr 24, 2026
@lachen-nv lachen-nv deleted the feat/grype-always-table branch April 24, 2026 07:41
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants