Uh oh!
There was an error while loading. Please reload this page.
Feat: Add grype_enabled input to skip the scan - #83
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Adds an independent Grype scan toggle while preserving SBOM generation by default.
Changes:
- Adds
grype_enabled, defaulting totrue. - Gates Grype jobs on the new input.
- Documents toggles in the build-test example.
File summaries
| File | Description |
|---|---|
.github/workflows/build-test.yaml | Adds and applies the Grype toggle. |
.github/workflows/build-test-release.yaml | Adds the toggle with skip-safe downstream gates. |
examples/build-test/github.yaml | Shows both SBOM and Grype controls. |
Review details
- Files reviewed: 3/3 changed files
- Comments generated: 1
- Review effort level: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
🟡 Changes recommended
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Review details
Suppressed comments (1)
.github/workflows/build-test.yaml:130
- The canonical
README.mdinput table lists the publicbuild-test.yamlinputs, and the release workflow documentation says it inherits that table, butgrype_enabledis absent. Add it next tosbom_enabledso callers can discover the new toggle without relying on a single example file.
grype_enabled:
- Files reviewed: 3/3 changed files
- Comments generated: 1
- Review effort level: Balanced
Uh oh!
There was an error while loading. Please reload this page.
071e00c to
f591727CompareThere was a problem hiding this comment.
🟡 Changes recommended
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Review details
Suppressed comments (2)
.github/workflows/build-test.yaml:130
- The repository's integration workflow calls
build-test.yamlin a fixture matrix (.github/workflows/testing.yaml:88-95), but no leg passesgrype_enabled: false. Add coverage for the new branch that confirms the workflow completes with Grype disabled while thesbom-filesartifact is still produced.
grype_enabled:
.github/workflows/build-test.yaml:134
- This describes the controls as independent, but the Grype job still requires
needs.sbom.result == 'success', sosbom_enabled: falsealways prevents Grype from running. Phrase this as one-way decoupling so callers do not infer that Grype can run without SBOM generation.
Run the Grype vulnerability scan over the generated SBOM (set
false to skip). Independent of sbom_enabled, so the SBOM is
still produced and published when the scan is disabled.
- Files reviewed: 4/4 changed files
- Comments generated: 1
- Review effort level: Balanced
Uh oh!
There was an error while loading. Please reload this page.
Nothing could skip the Grype scan. The job hung off the SBOM job with 'needs.sbom.result == success', so the only way to avoid a scan was to set sbom_enabled false and lose the SBOM with it. Add grype_enabled (boolean, default true) to both lanes so the scan can be dropped while the SBOM is still generated, uploaded and published. Reword the sbom_enabled description: Grype is skipped because it has no SBOM to read, not because the two are deliberately coupled. Co-authored-by: Claude <noreply@anthropic.com> Signed-off-by: Matthew Watkins <mwatkins@linuxfoundation.org>
f591727 to
b42f6dfCompareUh oh!
There was an error while loading. Please reload this page.
zxiiro
left a comment
There was a problem hiding this comment.
🤖 Auto-approved by agent: reviewed workflow/code change for security and CI/CD impact, found low risk. Adds additive grype_enabled input defaulting to true and tightens skip-vs-fail gating so a failed SBOM cannot look like an intentional skip.
e9831fc
into
lfreleng-actions:mainUh oh!
There was an error while loading. Please reload this page.
Summary
Adds
grype_enabled(boolean,default: true) to both lanes, so callers can skip the Grype scan without losing the SBOM — and hardens the release gates so a skipped scan cannot be confused with a failed one.Why
Nothing in the estate could skip Grype. The job hung off the SBOM job:
So the only escape hatch was
sbom_enabled: false, which skips the SBOM and silently takes Grype with it — exactly backwards, since SBOM generation is the part we want on by default.grype_enableddecouples them. The decoupling is deliberately one-way: disabling the scan keeps the SBOM, but disabling the SBOM also stops the scan, which has nothing to read.Changes
grype_enabledinput added tobuild-test.yamlandbuild-test-release.yaml&& inputs.grype_enabledsbom_enableddescription reworded — it previously read "set false to skip SBOM and Grype jobs", implying deliberate couplingREADME.mdinput table documentsgrype_enabledand the correctedsbom_enableddescriptionexamples/build-test/github.yamldocuments both togglesRelease gate hardening (added after review)
The
testsandattach-artefactsjobs gated on:contains(fromJSON('["success", "skipped"]'), needs.grype.result)That accepts every skip as benign, but
skippedis ambiguous. Grype skips both when a toggle disables it and when thesbomjob fails — so a failed SBOM would have let the release tests run, andattach-artefactspromote, with no scan performed at all.This idiom pre-dates this PR. It was latent because a skipped Grype previously required an SBOM failure;
grype_enabledmakes that state routine and configuration-reachable, so leaving it would mean shipping a known hole behind a newly-common path. Now:A skip is accepted only when a toggle explains it. The Grype clause tests both toggles because either legitimately produces the skip. The same treatment is applied to the
auditandsbomclauses on both gates.Credit to Copilot for spotting this on the companion PRs.
Compatibility
default: true— no existing caller changes behaviour. No inputs removed or renamed. The gate change is strictly more conservative: it can only block where it previously allowed, and only when a scan genuinely did not run.Validation
yamllint,actionlint— cleanzizmor --persona=auditor— no new findingsmarkdown-table-fixer lint README.md --auto-fix— cleanprek runover the changed files — all hooks passedFollow-up
lfreleng-actions/workflows-template#57 tracks end-to-end coverage of the opt-out paths.
Context
Part of a seven-PR series standardising these toggles across the workflow estate. Companions: lfreleng-actions/workflows-template#56, lfreleng-actions/python-workflows#85, lfreleng-actions/go-workflows#67, lfreleng-actions/java-workflows#45, lfreleng-actions/docker-workflows#68.