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
|
verbose: true
|
||||||
output_path: myoutput/
|
output_path: myoutput/
|
||||||
output_formats: sarif
|
output_formats: sarif
|
||||||
ignore_on_exit: results
|
ignore_on_exit: errors
|
||||||
enable_comments: true
|
enable_comments: true
|
||||||
- run: ls -la && ls -la myoutput
|
- run: ls -la && ls -la myoutput
|
||||||
if: always()
|
if: always()
|
||||||
|
8
dist/index.js
vendored
8
dist/index.js
vendored
@ -18063,8 +18063,8 @@ async function scanWithKICS(enableComments) {
|
|||||||
resultsFile = './results.json';
|
resultsFile = './results.json';
|
||||||
} else {
|
} else {
|
||||||
const outputFormats = core.getInput('output_formats');
|
const outputFormats = core.getInput('output_formats');
|
||||||
if (!outputFormats.toLowerCase().indexOf('json')) {
|
if (outputFormats.toLowerCase().indexOf('json') == -1) {
|
||||||
cmdArgs.push('--output-formats');
|
cmdArgs.push('--report-formats');
|
||||||
cmdArgs.push('json');
|
cmdArgs.push('json');
|
||||||
}
|
}
|
||||||
let resultsDir = core.getInput('output_path');
|
let resultsDir = core.getInput('output_path');
|
||||||
@ -18334,6 +18334,10 @@ const exitStatus = {
|
|||||||
function setWorkflowStatus(statusCode) {
|
function setWorkflowStatus(statusCode) {
|
||||||
console.log(`KICS scan status code: ${statusCode}`);
|
console.log(`KICS scan status code: ${statusCode}`);
|
||||||
|
|
||||||
|
if (statusCode === 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
const ignoreOnExit = core.getInput('ignore_on_exit');
|
const ignoreOnExit = core.getInput('ignore_on_exit');
|
||||||
|
|
||||||
if (ignoreOnExit.toLowerCase() === 'all') {
|
if (ignoreOnExit.toLowerCase() === 'all') {
|
||||||
|
@ -34,6 +34,10 @@ const exitStatus = {
|
|||||||
function setWorkflowStatus(statusCode) {
|
function setWorkflowStatus(statusCode) {
|
||||||
console.log(`KICS scan status code: ${statusCode}`);
|
console.log(`KICS scan status code: ${statusCode}`);
|
||||||
|
|
||||||
|
if (statusCode === 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
const ignoreOnExit = core.getInput('ignore_on_exit');
|
const ignoreOnExit = core.getInput('ignore_on_exit');
|
||||||
|
|
||||||
if (ignoreOnExit.toLowerCase() === 'all') {
|
if (ignoreOnExit.toLowerCase() === 'all') {
|
||||||
|
@ -74,8 +74,8 @@ async function scanWithKICS(enableComments) {
|
|||||||
resultsFile = './results.json';
|
resultsFile = './results.json';
|
||||||
} else {
|
} else {
|
||||||
const outputFormats = core.getInput('output_formats');
|
const outputFormats = core.getInput('output_formats');
|
||||||
if (!outputFormats.toLowerCase().indexOf('json')) {
|
if (outputFormats.toLowerCase().indexOf('json') == -1) {
|
||||||
cmdArgs.push('--output-formats');
|
cmdArgs.push('--report-formats');
|
||||||
cmdArgs.push('json');
|
cmdArgs.push('json');
|
||||||
}
|
}
|
||||||
let resultsDir = core.getInput('output_path');
|
let resultsDir = core.getInput('output_path');
|
||||||
|
Reference in New Issue
Block a user