mirror of
https://github.com/hadolint/hadolint-action.git
synced 2026-09-04 06:39:22 +00:00
features: config options, saving to file, SARIF
- Upgrade to Hadolint 2.8.0, enabling the SARIF formatter - Expand config options to reflect more of those regularly available with Hadolint including `no-fail` and `failure-threshold` options - Enable the creation of report files Breaking change: The list of ignored rules is now comma separated and not space separated. fixes: #23 fixes: #36 fixes: #42
This commit is contained in:
+11
-5
@@ -23,9 +23,13 @@ if [ -n "$HADOLINT_CONFIG" ]; then
|
||||
HADOLINT_CONFIG="-c ${HADOLINT_CONFIG}"
|
||||
fi
|
||||
|
||||
for i in $HADOLINT_IGNORE; do
|
||||
HADOLINT_IGNORE_CMDLINE="${HADOLINT_IGNORE_CMDLINE} --ignore=${i}"
|
||||
done
|
||||
OUTPUT=
|
||||
if [ -n "$HADOLINT_OUTPUT" ]; then
|
||||
if [ -f "$HADOLINT_OUTPUT" ]; then
|
||||
HADOLINT_OUTPUT="$TMP_FOLDER/$HADOLINT_OUTPUT"
|
||||
fi
|
||||
OUTPUT=" | tee $HADOLINT_OUTPUT"
|
||||
fi
|
||||
|
||||
if [ "$HADOLINT_RECURSIVE" = "true" ]; then
|
||||
shopt -s globstar
|
||||
@@ -33,8 +37,10 @@ if [ "$HADOLINT_RECURSIVE" = "true" ]; then
|
||||
filename="${!#}"
|
||||
flags="${@:1:$#-1}"
|
||||
|
||||
hadolint $HADOLINT_IGNORE_CMDLINE $HADOLINT_CONFIG $flags **/$filename
|
||||
hadolint $HADOLINT_CONFIG $flags **/$filename $OUTPUT
|
||||
else
|
||||
# shellcheck disable=SC2086
|
||||
hadolint $HADOLINT_IGNORE_CMDLINE $HADOLINT_CONFIG "$@"
|
||||
hadolint $HADOLINT_CONFIG "$@" $OUTPUT
|
||||
fi
|
||||
|
||||
[ -z "$HADOLINT_OUTPUT" ] || echo "Hadolint output saved to: $HADOLINT_OUTPUT"
|
||||
|
||||
Reference in New Issue
Block a user