fixing status code 0 handling
Signed-off-by: Rogério Peixoto <rogerio.peixoto@checkmarx.com>
This commit is contained in:
2
.github/workflows/test_action.yaml
vendored
2
.github/workflows/test_action.yaml
vendored
@ -19,7 +19,7 @@ jobs:
|
||||
verbose: true
|
||||
output_path: myoutput/
|
||||
output_formats: sarif
|
||||
ignore_on_exit: results
|
||||
ignore_on_exit: errors
|
||||
enable_comments: true
|
||||
- run: ls -la && ls -la myoutput
|
||||
if: always()
|
||||
|
8
dist/index.js
vendored
8
dist/index.js
vendored
@ -18063,8 +18063,8 @@ async function scanWithKICS(enableComments) {
|
||||
resultsFile = './results.json';
|
||||
} else {
|
||||
const outputFormats = core.getInput('output_formats');
|
||||
if (!outputFormats.toLowerCase().indexOf('json')) {
|
||||
cmdArgs.push('--output-formats');
|
||||
if (outputFormats.toLowerCase().indexOf('json') == -1) {
|
||||
cmdArgs.push('--report-formats');
|
||||
cmdArgs.push('json');
|
||||
}
|
||||
let resultsDir = core.getInput('output_path');
|
||||
@ -18334,6 +18334,10 @@ const exitStatus = {
|
||||
function setWorkflowStatus(statusCode) {
|
||||
console.log(`KICS scan status code: ${statusCode}`);
|
||||
|
||||
if (statusCode === 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
const ignoreOnExit = core.getInput('ignore_on_exit');
|
||||
|
||||
if (ignoreOnExit.toLowerCase() === 'all') {
|
||||
|
@ -34,6 +34,10 @@ const exitStatus = {
|
||||
function setWorkflowStatus(statusCode) {
|
||||
console.log(`KICS scan status code: ${statusCode}`);
|
||||
|
||||
if (statusCode === 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
const ignoreOnExit = core.getInput('ignore_on_exit');
|
||||
|
||||
if (ignoreOnExit.toLowerCase() === 'all') {
|
||||
|
@ -74,8 +74,8 @@ async function scanWithKICS(enableComments) {
|
||||
resultsFile = './results.json';
|
||||
} else {
|
||||
const outputFormats = core.getInput('output_formats');
|
||||
if (!outputFormats.toLowerCase().indexOf('json')) {
|
||||
cmdArgs.push('--output-formats');
|
||||
if (outputFormats.toLowerCase().indexOf('json') == -1) {
|
||||
cmdArgs.push('--report-formats');
|
||||
cmdArgs.push('json');
|
||||
}
|
||||
let resultsDir = core.getInput('output_path');
|
||||
|
Reference in New Issue
Block a user