From 41f05d9ecffa2ed3f1580af306000f734b733e54 Mon Sep 17 00:00:00 2001 From: Simar Date: Fri, 9 Jun 2023 16:37:12 -0600 Subject: [PATCH] Revert "Include args when using trivy config file (#231)" Fixes: https://github.com/aquasecurity/trivy-action/issues/238 This reverts commit 82ec0dd604dba823f8d78b0ae2655450d8fe3a55. --- entrypoint.sh | 2 +- test/data/trivy-reduced.yaml | 3 --- test/test.bats | 8 -------- 3 files changed, 1 insertion(+), 12 deletions(-) delete mode 100644 test/data/trivy-reduced.yaml diff --git a/entrypoint.sh b/entrypoint.sh index b08dd17..26a9dae 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -180,7 +180,7 @@ if [ "${format}" == "sarif" ] && [ "${limitSeveritiesForSARIF}" != "true" ]; the trivy --quiet ${scanType} --format sarif --output ${output} $SARIF_ARGS ${artifactRef} elif [ $trivyConfig ]; then echo "Running Trivy with trivy.yaml config from: " $trivyConfig - trivy --config $trivyConfig ${ARGS} ${scanType} ${artifactRef} + trivy --config $trivyConfig ${scanType} ${artifactRef} returnCode=$? else echo "Running trivy with options: trivy ${scanType} ${ARGS}" "${artifactRef}" diff --git a/test/data/trivy-reduced.yaml b/test/data/trivy-reduced.yaml deleted file mode 100644 index 1b7da61..0000000 --- a/test/data/trivy-reduced.yaml +++ /dev/null @@ -1,3 +0,0 @@ -vulnerability: - type: os -output: yamlconfig.test \ No newline at end of file diff --git a/test/test.bats b/test/test.bats index 5c87409..13a69ce 100644 --- a/test/test.bats +++ b/test/test.bats @@ -81,11 +81,3 @@ bats_load_library bats-file echo "$output" assert_files_equal yamlconfig.test ./test/data/yamlconfig.test } - -@test "trivy image with trivy.yaml config and args" { - # trivy --config=./test/data/trivy-reduced.yaml image alpine:3.10 - run ./entrypoint.sh "-v ./test/data/trivy-reduced.yaml" "-a image" "-i alpine:3.10" "-b json" "-g CRITICAL" - run diff yamlconfig.test ./test/data/yamlconfig.test - echo "$output" - assert_files_equal yamlconfig.test ./test/data/yamlconfig.test -}