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:
parent
96339c1113
commit
63666e594d
1 changed files with 5 additions and 2 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue