Skip to content

Commit

Permalink
PA-15666 fix outputFormat parse
Browse files Browse the repository at this point in the history
  • Loading branch information
SOOS-GSteen committed Oct 7, 2024
1 parent d7e019d commit c28c977
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 37 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ docker run -it --rm \
| `--onFailure` | `continue_on_failure` | Action to perform when the scan fails. Options: fail_the_build, continue_on_failure. |
| `--operatingEnvironment` | | Set Operating environment for information purposes only. |
| `--otherOptions` | | Other Options to pass to syft. |
| `--outputFormat` | | Output format for vulnerabilities: only the value SARIF is available at the moment |
| `--projectName` | | Project Name - this is what will be displayed in the SOOS app. |
| `targetToScan` | | The target to scan. Should be a docker image name or a path to a directory containing a Dockerfile. |

Expand Down
43 changes: 15 additions & 28 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"author": "SOOS",
"publisher": "SOOS",
"license": "MIT",
"version": "2.0.1",
"version": "2.0.2",
"main": "dist/index.js",
"scripts": {
"setup:install": "npm install",
Expand Down Expand Up @@ -42,7 +42,7 @@
},
"homepage": "https://github.com/soos-io/soos-csa#readme",
"dependencies": {
"@soos-io/api-client": "1.0.5",
"@soos-io/api-client": "1.0.6",
"argparse": "^2.0.1",
"glob": "^11.0.0",
"tslib": "^2.7.0"
Expand Down
15 changes: 8 additions & 7 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { exit } from "process";
import { spawn } from "child_process";
import FormData from "form-data";
import {
ensureEnumValue,
getAnalysisExitCodeWithMessage,
obfuscateProperties,
} from "@soos-io/api-client/dist/utilities";
Expand Down Expand Up @@ -40,13 +39,15 @@ class SOOSCSAAnalysis {

analysisArgumentParser.addBaseScanArguments();

analysisArgumentParser.argumentParser.add_argument("--outputFormat", {
help: "Output format for vulnerabilities: only the value SARIF is available at the moment",
required: false,
type: (value: string) => {
return ensureEnumValue(OutputFormat, value);
analysisArgumentParser.addEnumArgument(
analysisArgumentParser.argumentParser,
"--outputFormat",
OutputFormat,
{
help: "Output format for vulnerabilities: only the value SARIF is available at the moment",
required: false,
},
});
);

analysisArgumentParser.argumentParser.add_argument("--otherOptions", {
help: "Other Options to pass to syft.",
Expand Down

0 comments on commit c28c977

Please sign in to comment.