From 7f39e491e762332c2d96f1a7e03ae6fa6a050e5f Mon Sep 17 00:00:00 2001 From: Martin Hrabovcin Date: Mon, 19 Feb 2024 18:07:05 +0100 Subject: [PATCH] chore: compare trivy reports --- .github/actions/copacetic-action/pkg/patch/task.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.github/actions/copacetic-action/pkg/patch/task.go b/.github/actions/copacetic-action/pkg/patch/task.go index 9702332..3d10b87 100644 --- a/.github/actions/copacetic-action/pkg/patch/task.go +++ b/.github/actions/copacetic-action/pkg/patch/task.go @@ -91,6 +91,16 @@ func Run(ctx context.Context, imageRef string, reg registry.Registry, imageTagSu patchedRef := imagePatch.SourceRef().Context().Tag(buildTag) logger.Info("regenerated image using copa", "patchedRef", patchedRef.String()) + patchedReport, err := image.Scan(ctx, patchedRef.String()) + if err != nil { + return withErr(t, err), err + } + logger.Info( + "patched vulnerability report", + "original", report.Vulnerabilities(), + "patched", patchedReport.Vulnerabilities(), + ) + // Add labels to the newly built image labels := map[string]string{ "com.d2iq.source-image": imagePatch.Source,