From b0c4da87511d18d55b490f305f31d618920593fd Mon Sep 17 00:00:00 2001 From: Artur Ribeiro Date: Thu, 15 Feb 2024 18:00:39 +0000 Subject: [PATCH] add critical to commenter and new package versions --- package.json | 10 ++++++---- src/commenter.js | 7 ++++++- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 921fd1d..7b04ac0 100644 --- a/package.json +++ b/package.json @@ -19,15 +19,17 @@ }, "homepage": "https://github.com/Checkmarx/kics-github-action#readme", "dependencies": { - "@actions/core": "^1.10.0", + "@actions/core": "^1.10.1", "@actions/exec": "^1.1.0", "@actions/github": "^5.0.0", "@actions/io": "^1.1.1", - "@actions/tool-cache": "^1.7.1", - "moment": "^2.29.4" + "@actions/tool-cache": "^2.0.1", + "moment": "^2.29.4", + "uuid": "^8.3.2" }, "devDependencies": { "@vercel/ncc": "^0.36.1", - "prettier": "^2.4.1" + "prettier": "^2.4.1", + "@types/uuid": "^8.3.4" } } diff --git a/src/commenter.js b/src/commenter.js index c313c21..f4f9eea 100644 --- a/src/commenter.js +++ b/src/commenter.js @@ -2,8 +2,9 @@ const moment = require('moment') const { summary } = require('@actions/core/lib/summary'); const kicsLogo = "https://user-images.githubusercontent.com/111127232/203838108-ad537fea-4573-495a-9619-18500ee81dd9.png" -const severityOrder = ["HIGH", "MEDIUM", "LOW", "INFO", "TRACE"]; +const severityOrder = ["CRITICAL","HIGH", "MEDIUM", "LOW", "INFO", "TRACE"]; const severityIcons = { + "CRITICAL": "https://raw.githubusercontent.com/Checkmarx/kics-github-action/4d8cbbe0ba84707403c8715f72a5ba12c90887ef/images/Critical.png", "HIGH": "https://user-images.githubusercontent.com/23239410/92157087-97285600-ee32-11ea-988f-0aca12c4c126.png", "MEDIUM": "https://user-images.githubusercontent.com/23239410/92157093-98598300-ee32-11ea-83d7-af52251a011b.png", "LOW": "https://user-images.githubusercontent.com/23239410/92157091-98598300-ee32-11ea-8498-19bd7d62019b.png", @@ -27,6 +28,10 @@ function createComment(results, withQueries = false, excludedColumnsForCommentsW if (severity in severityCounters) { message += `| ![${severity}](${severityIcons[severity]}) | ${severity.toUpperCase()} | ${severityCounters[severity.toUpperCase()]} |\n`; } + else { + const imageTag = `${severity}`; + message += `| ${imageTag} | ${severity.toUpperCase()} | 0 |\n`; + } } message += `| ![TOTAL](${emptyIcon}) | TOTAL | ${results['total_counter']} |`;