Adds support for multiple dockerfile targets

This commit is contained in:
Derek Ditch 2025-05-28 15:38:59 -05:00
parent f49a60108f
commit a50bc6da73
2 changed files with 6 additions and 4 deletions

View file

@ -4,7 +4,7 @@ author: 'Bruno Paz'
inputs:
dockerfile:
required: false
description: 'The path to the Dockerfile to lint'
description: 'Path to Dockerfile(s). Provide a single path or multiple paths space-separated (e.g., "Dockerfile path/to/another/Dockerfile").'
default: 'Dockerfile'
format:
required: false

View file

@ -12,8 +12,8 @@ chmod -R a+rX "${TMP_FOLDER}"
# the repository so we don't leave the checkout dirty. We also remove
# the matcher so it won't take effect in later steps.
cleanup() {
echo "::remove-matcher owner=brpaz/hadolint-action::"
rm -rf "${TMP_FOLDER}"
echo "::remove-matcher owner=brpaz/hadolint-action::"
rm -rf "${TMP_FOLDER}"
}
trap cleanup EXIT
@ -27,5 +27,7 @@ for i in $HADOLINT_IGNORE; do
HADOLINT_IGNORE_CMDLINE="${HADOLINT_IGNORE_CMDLINE} --ignore=${i}"
done
DOCKERFILE_LIST=$(printf '%s ' "$@")
# shellcheck disable=SC2086
hadolint $HADOLINT_IGNORE_CMDLINE $HADOLINT_CONFIG "$@"
hadolint $HADOLINT_IGNORE_CMDLINE $HADOLINT_CONFIG $DOCKERFILE_LIST