File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -61,6 +61,11 @@ if [ $input ]; then
6161fi
6262ignoreUnfixed=$( echo $ignoreUnfixed | tr -d ' \r' )
6363
64+ GLOBAL_ARGS=" "
65+ if [ $cacheDir ]; then
66+ GLOBAL_ARGS=" $GLOBAL_ARGS --cache-dir $cacheDir "
67+ fi
68+
6469ARGS=" "
6570if [ $format ]; then
6671 ARGS=" $ARGS --format $format "
@@ -89,9 +94,6 @@ if [ $skipDirs ];then
8994 ARGS=" $ARGS --skip-dirs $i "
9095 done
9196fi
92- if [ $cacheDir ]; then
93- ARGS=" $ARGS --cache-dir $cacheDir "
94- fi
9597if [ $timeout ]; then
9698 ARGS=" $ARGS --timeout $timeout "
9799fi
@@ -100,4 +102,5 @@ if [ $ignorePolicy ];then
100102fi
101103
102104echo " Running trivy with options: " --no-progress " ${ARGS} " " ${artifactRef} "
103- trivy ${scanType} --no-progress $ARGS ${artifactRef}
105+ echo " Global options: " " ${GLOBAL_ARGS} "
106+ trivy $GLOBAL_ARGS ${scanType} --no-progress $ARGS ${artifactRef}
You can’t perform that action at this time.
0 commit comments