Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 18 additions & 12 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const fs = __webpack_require__(747);
const stream = __webpack_require__(413);

const grypeBinary = "grype";
const grypeVersion = "0.22.0";
const grypeVersion = "0.27.3";

// sarif code
function convert_severity_to_acs_level(input_severity, severity_cutoff_param) {
Expand Down Expand Up @@ -513,21 +513,27 @@ async function runScan({
},
});

const cmdOpts = {
ignoreReturnCode: true,
outStream,
listeners: {
stdout: (data = Buffer) => {
cmdOutput += data.toString();
},
},
};

core.info("\nAnalyzing: " + source);

core.info(`Executing: ${cmd} ` + cmdArgs.join(" "));

const exitCode = await exec(cmd, cmdArgs, cmdOpts);
const exitCode = await core.group(`${cmd} output...`, async () =>
exec(cmd, cmdArgs, {
ignoreReturnCode: true,
outStream,
listeners: {
stdout(buffer) {
cmdOutput += buffer.toString();
},
stderr(buffer) {
core.info(buffer.toString());
},
debug(message) {
core.debug(message);
},
},
})
);

if (core.isDebug()) {
core.debug("Grype output:");
Expand Down
28 changes: 17 additions & 11 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -506,21 +506,27 @@ async function runScan({
},
});

const cmdOpts = {
ignoreReturnCode: true,
outStream,
listeners: {
stdout: (data = Buffer) => {
cmdOutput += data.toString();
},
},
};

core.info("\nAnalyzing: " + source);

core.info(`Executing: ${cmd} ` + cmdArgs.join(" "));

const exitCode = await exec(cmd, cmdArgs, cmdOpts);
const exitCode = await core.group(`${cmd} output...`, async () =>
exec(cmd, cmdArgs, {
ignoreReturnCode: true,
outStream,
listeners: {
stdout(buffer) {
cmdOutput += buffer.toString();
},
stderr(buffer) {
core.info(buffer.toString());
},
debug(message) {
core.debug(message);
},
},
})
);

if (core.isDebug()) {
core.debug("Grype output:");
Expand Down