Code update
This commit is contained in:
10
docker-scout/dist/index.js
vendored
10
docker-scout/dist/index.js
vendored
@@ -27617,15 +27617,19 @@ async function runScoutCommand(commands, image, format, outputFile) {
|
|||||||
core.setOutput('result-file', resultPath);
|
core.setOutput('result-file', resultPath);
|
||||||
|
|
||||||
for (const cmd of commands) {
|
for (const cmd of commands) {
|
||||||
|
const args = ['scout', cmd, image];
|
||||||
|
if (cmd == 'cves') {
|
||||||
|
args.push('--format', format);
|
||||||
|
}
|
||||||
|
|
||||||
if (outputFile) {
|
if (outputFile) {
|
||||||
const res = await exec.getExecOutput('docker', ['scout', cmd, image, '--format', format], { silent: true });
|
const res = await exec.getExecOutput('docker', args, { silent: true });
|
||||||
if (res.stderr && res.stderr.length > 0) {
|
if (res.stderr && res.stderr.length > 0) {
|
||||||
throw new Error(res.stderr);
|
throw new Error(res.stderr);
|
||||||
}
|
}
|
||||||
|
|
||||||
fs.appendFile(resultPath, res.stdout);
|
fs.appendFile(resultPath, res.stdout);
|
||||||
} else {
|
} else {
|
||||||
await exec.exec('docker', ['scout', cmd, image, '--format', format]);
|
await exec.exec('docker', args);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return resultPath;
|
return resultPath;
|
||||||
|
|||||||
@@ -60,15 +60,19 @@ async function runScoutCommand(commands, image, format, outputFile) {
|
|||||||
core.setOutput('result-file', resultPath);
|
core.setOutput('result-file', resultPath);
|
||||||
|
|
||||||
for (const cmd of commands) {
|
for (const cmd of commands) {
|
||||||
|
const args = ['scout', cmd, image];
|
||||||
|
if (cmd == 'cves') {
|
||||||
|
args.push('--format', format);
|
||||||
|
}
|
||||||
|
|
||||||
if (outputFile) {
|
if (outputFile) {
|
||||||
const res = await exec.getExecOutput('docker', ['scout', cmd, image, '--format', format], { silent: true });
|
const res = await exec.getExecOutput('docker', args, { silent: true });
|
||||||
if (res.stderr && res.stderr.length > 0) {
|
if (res.stderr && res.stderr.length > 0) {
|
||||||
throw new Error(res.stderr);
|
throw new Error(res.stderr);
|
||||||
}
|
}
|
||||||
|
|
||||||
fs.appendFile(resultPath, res.stdout);
|
fs.appendFile(resultPath, res.stdout);
|
||||||
} else {
|
} else {
|
||||||
await exec.exec('docker', ['scout', cmd, image, '--format', format]);
|
await exec.exec('docker', args);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return resultPath;
|
return resultPath;
|
||||||
|
|||||||
Reference in New Issue
Block a user