Skip to content

Commit 436a82b

Browse files
authored
Update entrypoint.js
1 parent d474fee commit 436a82b

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

entrypoint.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ const RED = '\x1b[31m'
1212
const YELLOW = '\x1b[33m'
1313
const WHITE = '\x1b[0m'
1414
const BLUE = '\x1b[34m'
15+
const VIOLET = '\x1b[35m'
1516
const RESET = '\x1b[0m'
1617
const opName = `Security`
1718

@@ -416,14 +417,14 @@ const processReport = function () {
416417
return {
417418
index: idx + 1,
418419
name: v.name.truncateLeft(30),
419-
severity: v.severity || '',
420+
severity: v.severity == 'Unknown' ? 'Information' : (v.severity || ''),
420421
category: v.category || '',
421422
identifier: (v.identifiers || []).map(i => i.type == 'cwe' ? undefined : i.value).filter(o => o),
422423
location: v.location.file.truncateLeft(30)
423424
}
424425
}))
425426
if (securityServerity.critical || securityServerity.high) {
426-
throw (`Analysed security report ${configInputFile} we had found (${securityServerity.critical}) in CRITICAL and (${securityServerity.high}) in HIGH severity that STOPPED you continuing your work.`)
427+
throw (`${RED}ERROR ${RESET}from ${RESET}${configInputFile}${RESET} - There are ${securityServerity.critical} ${VIOLET}(CRITICAL)${RESET} and ${securityServerity.high} ${YELLOW}(HIGH)${RESET} severity findings.${RESET}`)
427428
}
428429
}
429430
} catch (err) {

0 commit comments

Comments
 (0)