From 96504d8f5bec61454faa16ca953e051a03ebdeda Mon Sep 17 00:00:00 2001 From: Keith Zantow Date: Mon, 4 Mar 2024 19:37:24 -0500 Subject: [PATCH 1/2] fix: reduce syft debug level Signed-off-by: Keith Zantow --- dist/attachReleaseAssets/index.js | 5 ++++- dist/downloadSyft/index.js | 5 ++++- dist/runSyftAction/index.js | 5 ++++- src/github/SyftGithubAction.ts | 6 +++++- 4 files changed, 17 insertions(+), 4 deletions(-) diff --git a/dist/attachReleaseAssets/index.js b/dist/attachReleaseAssets/index.js index a9f41d5e..a4b4c0c0 100644 --- a/dist/attachReleaseAssets/index.js +++ b/dist/attachReleaseAssets/index.js @@ -24039,7 +24039,10 @@ function executeSyft(_a) { } } // https://github.com/anchore/syft#configuration - let args = ["packages", "-vv"]; + let args = ["scan"]; + if (core.isDebug()) { + args = [...args, "-vv"]; + } if ("image" in input && input.image) { if (registryUser) { args = [...args, `registry:${input.image}`]; diff --git a/dist/downloadSyft/index.js b/dist/downloadSyft/index.js index 79bf17d1..f64314d2 100644 --- a/dist/downloadSyft/index.js +++ b/dist/downloadSyft/index.js @@ -24087,7 +24087,10 @@ function executeSyft(_a) { } } // https://github.com/anchore/syft#configuration - let args = ["packages", "-vv"]; + let args = ["scan"]; + if (core.isDebug()) { + args = [...args, "-vv"]; + } if ("image" in input && input.image) { if (registryUser) { args = [...args, `registry:${input.image}`]; diff --git a/dist/runSyftAction/index.js b/dist/runSyftAction/index.js index 7e5fd7c8..6d8aa6f3 100644 --- a/dist/runSyftAction/index.js +++ b/dist/runSyftAction/index.js @@ -24039,7 +24039,10 @@ function executeSyft(_a) { } } // https://github.com/anchore/syft#configuration - let args = ["packages", "-vv"]; + let args = ["scan"]; + if (core.isDebug()) { + args = [...args, "-vv"]; + } if ("image" in input && input.image) { if (registryUser) { args = [...args, `registry:${input.image}`]; diff --git a/src/github/SyftGithubAction.ts b/src/github/SyftGithubAction.ts index 0c8240cd..45145c3b 100644 --- a/src/github/SyftGithubAction.ts +++ b/src/github/SyftGithubAction.ts @@ -127,7 +127,11 @@ async function executeSyft({ } // https://github.com/anchore/syft#configuration - let args = ["packages", "-vv"]; + let args = ["scan"]; + + if (core.isDebug()) { + args = [...args, "-vv"]; + } if ("image" in input && input.image) { if (registryUser) { From 96df2fd69f22c80aeeff07e2f79a6d288bf6b4b4 Mon Sep 17 00:00:00 2001 From: Keith Zantow Date: Mon, 4 Mar 2024 19:47:40 -0500 Subject: [PATCH 2/2] chore: update tests Signed-off-by: Keith Zantow --- tests/SyftGithubAction.test.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/SyftGithubAction.test.ts b/tests/SyftGithubAction.test.ts index ed62205c..956e53a9 100644 --- a/tests/SyftGithubAction.test.ts +++ b/tests/SyftGithubAction.test.ts @@ -65,8 +65,8 @@ describe("Action", () => { const { args } = data.execArgs; expect(args).toBeDefined() - expect(args.length > 2).toBeTruthy(); - expect(args[2]).toBe("some-image:latest") + expect(args.length > 1).toBeTruthy(); + expect(args[1]).toBe("some-image:latest") }); it("runs with path input", async () => { @@ -81,8 +81,8 @@ describe("Action", () => { const { args } = data.execArgs; expect(args).toBeDefined() - expect(args.length > 2).toBeTruthy(); - expect(args[2]).toBe("dir:some-path") + expect(args.length > 1).toBeTruthy(); + expect(args[1]).toBe("dir:some-path") }); it("runs with file input", async () => { @@ -97,8 +97,8 @@ describe("Action", () => { const { args } = data.execArgs; expect(args).toBeDefined() - expect(args.length > 2).toBeTruthy(); - expect(args[2]).toBe("file:some-file.jar") + expect(args.length > 1).toBeTruthy(); + expect(args[1]).toBe("file:some-file.jar") }); it("runs with release uploads inputs", async () => {