From 3a1819d787f2feda2d91e704130436d4cb6f0807 Mon Sep 17 00:00:00 2001 From: patrick brisbin Date: Tue, 14 May 2024 11:16:47 -0400 Subject: [PATCH] Build --- dist/index.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/dist/index.js b/dist/index.js index 569df24..e6a286a 100644 --- a/dist/index.js +++ b/dist/index.js @@ -136,7 +136,7 @@ var sr = __importStar(__nccwpck_require__(6889)); var inputs_1 = __nccwpck_require__(6180); function run() { return __awaiter(this, void 0, void 0, function () { - var _a, wizClientId, wizClientSecret, wizApiEndpointUrl, wizApiIdP, image, customPolicies, pull, fail_1, wizCredentials, wizcli, _b, scanId, scanPassed, result, summary, error_1, error_2; + var _a, wizClientId, wizClientSecret, wizApiEndpointUrl, wizApiIdP, image, customPolicies, pull, fail_1, wizCredentials, wizcli, _b, scanId, scanPassed, result, summary, error_1, resultUrlBase, resultUrlHash, resultUrl, error_2; return __generator(this, function (_c) { switch (_c.label) { case 0: @@ -182,11 +182,16 @@ function run() { } return [3, 9]; case 9: + resultUrlBase = "https://app.wiz.io/reports/cicd-scans"; + resultUrlHash = fixedEncodeURIComponent("~(cicd_scan~'".concat(scanId, ")")); + resultUrl = "".concat(resultUrlBase, "#").concat(resultUrlHash); if (scanPassed) { + core.info("Scan passed: ".concat(resultUrl)); core.setOutput("scan-id", scanId); core.setOutput("scan-result", "success"); } else { + core.warning("Scan failed: ".concat(resultUrl)); core.setOutput("scan-id", scanId); core.setOutput("scan-result", "failed"); if (fail_1) { @@ -211,6 +216,11 @@ function run() { }); }); } +function fixedEncodeURIComponent(str) { + return encodeURIComponent(str).replace(/[!'()*]/g, function (c) { + return "%" + c.charCodeAt(0).toString(16); + }); +} run();