Skip to content

Commit

Permalink
fix: set return code after each Trivy call (#247)
Browse files Browse the repository at this point in the history
This change moves the return code to outside the trivy call. This fixes
#228 as the return code was not being propagated.
  • Loading branch information
LiamMacP authored Nov 7, 2023
1 parent f78e9ec commit 7b07fa7
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 7b07fa7

Please sign in to comment.