Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add parameter tflint_config #68

Merged
merged 5 commits into from
Apr 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 6 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,11 @@ inputs:
The target dir for the tflint command. This is the directory passed to tflint as opposed to working_directory which is the directory the command is executed from.
Default is . ( root of the repository)
default: '.'
tflint_config:
description: |
Config file name for tflint.
Default is `.tflint.hcl`.
default: '.tflint.hcl'
flags:
description: |
List of arguments to send to tflint
Expand Down Expand Up @@ -87,6 +92,7 @@ runs:
INPUT_TFLINT_RULESETS: ${{ inputs.tflint_rulesets }}
INPUT_TFLINT_INIT: ${{ inputs.tflint_init }}
INPUT_TFLINT_TARGET_DIR: ${{ inputs.tflint_target_dir }}
INPUT_TFLINT_CONFIG: ${{ inputs.tflint_config }}
INPUT_FLAGS: ${{ inputs.flags }}

branding:
Expand Down
6 changes: 3 additions & 3 deletions script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ done
case "${INPUT_TFLINT_INIT:-false}" in
true)
echo "::group:: Initialize tflint from local configuration"
TFLINT_PLUGIN_DIR="${TFLINT_PLUGIN_DIR}" GITHUB_TOKEN="${INPUT_GITHUB_TOKEN}" "${TFLINT_PATH}/tflint" --init
TFLINT_PLUGIN_DIR="${TFLINT_PLUGIN_DIR}" GITHUB_TOKEN="${INPUT_GITHUB_TOKEN}" "${TFLINT_PATH}/tflint" --init -c "${INPUT_TFLINT_CONFIG}"
echo "::endgroup::"
;;
false)
Expand All @@ -87,7 +87,7 @@ case "${INPUT_TFLINT_INIT:-false}" in
esac

echo "::group:: Print tflint details ..."
"${TFLINT_PATH}/tflint" --version
"${TFLINT_PATH}/tflint" --version -c "${INPUT_TFLINT_CONFIG}"
echo '::endgroup::'


Expand All @@ -98,7 +98,7 @@ echo '::group:: Running tflint with reviewdog 🐶 ...'
set +Eeuo pipefail

# shellcheck disable=SC2086
TFLINT_PLUGIN_DIR=${TFLINT_PLUGIN_DIR} "${TFLINT_PATH}/tflint" --format=checkstyle ${INPUT_FLAGS} ${INPUT_TFLINT_TARGET_DIR} \
TFLINT_PLUGIN_DIR=${TFLINT_PLUGIN_DIR} "${TFLINT_PATH}/tflint" -c "${INPUT_TFLINT_CONFIG}" --format=checkstyle ${INPUT_FLAGS} ${INPUT_TFLINT_TARGET_DIR} \
| "${REVIEWDOG_PATH}/reviewdog" -f=checkstyle \
-name="tflint" \
-reporter="${INPUT_REPORTER}" \
Expand Down