1
0
Fork 0
mirror of https://github.com/hadolint/hadolint-action.git synced 2024-08-16 10:09:53 +02:00

Apply exit code to hadolint.sh

This commit is contained in:
Paul Barton 2022-03-24 12:57:02 +00:00
parent 96339c1113
commit 63666e594d

View file

@ -27,16 +27,19 @@ if [ -n "$HADOLINT_OUTPUT" ]; then
OUTPUT=" | tee $HADOLINT_OUTPUT"
fi
FAILED=0
if [ "$HADOLINT_RECURSIVE" = "true" ]; then
shopt -s globstar
filename="${!#}"
flags="${@:1:$#-1}"
hadolint $HADOLINT_CONFIG $flags **/$filename $OUTPUT
hadolint $HADOLINT_CONFIG $flags **/$filename $OUTPUT || FAILED=1
else
# shellcheck disable=SC2086
hadolint $HADOLINT_CONFIG "$@" $OUTPUT
hadolint $HADOLINT_CONFIG "$@" $OUTPUT || FAILED=1
fi
[ -z "$HADOLINT_OUTPUT" ] || echo "Hadolint output saved to: $HADOLINT_OUTPUT"
exit $FAILED