From 8300095cff9e421b8692f3f630d2d76adafd8fd8 Mon Sep 17 00:00:00 2001 From: Benji Visser Date: Fri, 8 Dec 2023 13:30:35 +0000 Subject: [PATCH 1/2] add api-key to action.yml Signed-off-by: Benji Visser --- action.yml | 3 +++ index.js | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/action.yml b/action.yml index d4f6d6e..5d61c9f 100644 --- a/action.yml +++ b/action.yml @@ -21,6 +21,9 @@ inputs: description: 'Set the output parameter after successful action execution. Valid choices are "json" and "table".' required: false default: "table" + api-key: + description: "The Xeol API key to use for scanning." + required: false outputs: json: description: "Path to a JSON report file for the image" diff --git a/index.js b/index.js index 19d4b05..8f7889d 100644 --- a/index.js +++ b/index.js @@ -167,7 +167,7 @@ async function runScan({ if (failBuild) { cmdArgs.push("--fail-on-eol-found"); } - if (apiKey) { + if (apiKey != "") { cmdArgs.push("--api-key", apiKey); } cmdArgs.push(source); From cd4ef7c7adab417dccfae7eed07ddabf8343a2b4 Mon Sep 17 00:00:00 2001 From: Benji Visser Date: Fri, 8 Dec 2023 13:35:19 +0000 Subject: [PATCH 2/2] fix tests Signed-off-by: Benji Visser --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index 8f7889d..19d4b05 100644 --- a/index.js +++ b/index.js @@ -167,7 +167,7 @@ async function runScan({ if (failBuild) { cmdArgs.push("--fail-on-eol-found"); } - if (apiKey != "") { + if (apiKey) { cmdArgs.push("--api-key", apiKey); } cmdArgs.push(source);