Skip to content

Commit

Permalink
Build
Browse files Browse the repository at this point in the history
  • Loading branch information
pbrisbin committed May 21, 2024
1 parent af56ef5 commit 710e937
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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) {
Expand All @@ -211,6 +216,11 @@ function run() {
});
});
}
function fixedEncodeURIComponent(str) {
return encodeURIComponent(str).replace(/[!'()*]/g, function (c) {
return "%" + c.charCodeAt(0).toString(16);
});
}
run();


Expand Down

0 comments on commit 710e937

Please sign in to comment.