Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PA-15666 fix outputFormat parse #40

Merged
merged 1 commit into from
Oct 7, 2024
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
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