Skip to content

Commit 0d104b5

Browse files
Ignore ephemeral packages during SBOM export
1 parent 5e46b45 commit 0d104b5

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

cmd/sbom-export.go

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,17 @@ If no package is specified, the workspace's default target is used.`,
6262
if withDependencies {
6363
// Get all dependencies
6464
deps := pkg.GetTransitiveDependencies()
65-
log.Infof("Exporting SBOMs for %s and %d dependencies to %s", pkg.FullName(), len(deps), outputDir)
6665

67-
allpkg = append(allpkg, deps...)
66+
// Skip ephemeral packages as they're not meant to be cached
67+
for _, p := range deps {
68+
if p.Ephemeral {
69+
log.Infof("Skipping vulnerability scan for ephemeral package %s\n", p.FullName())
70+
continue
71+
}
72+
allpkg = append(allpkg, p)
73+
}
74+
75+
log.Infof("Exporting SBOMs for %s and %d dependencies to %s", pkg.FullName(), len(allpkg)-1, outputDir)
6876
}
6977

7078
for _, p := range allpkg {

0 commit comments

Comments
 (0)