fix: set return code after each Trivy call (#247)

This change moves the return code to outside the trivy call. This fixes
#228 as the return code was not being propagated.
pull/266/merge
Liam MacPherson 6 months ago committed by GitHub
parent f78e9ecf42
commit 7b07fa7d6a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -181,13 +181,12 @@ if [ "${format}" == "sarif" ] && [ "${limitSeveritiesForSARIF}" != "true" ]; the
elif [ $trivyConfig ]; then
echo "Running Trivy with trivy.yaml config from: " $trivyConfig
trivy --config $trivyConfig ${scanType} ${artifactRef}
returnCode=$?
else
echo "Running trivy with options: trivy ${scanType} ${ARGS}" "${artifactRef}"
echo "Global options: " "${GLOBAL_ARGS}"
trivy $GLOBAL_ARGS ${scanType} ${ARGS} ${artifactRef}
returnCode=$?
fi
returnCode=$?
set -e
if [[ "${format}" == "github" ]]; then

Loading…
Cancel
Save