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 tflint Target Directory Parameter #59

Merged
merged 3 commits into from
Oct 29, 2022
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,11 @@ inputs:
Whether or not to run tflint --init prior to running scan [true,false]
Default is `false`.
default: 'false'
tflint_target_dir:
description: |
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: '.'
flags:
description: |
List of arguments to send to tflint
Expand Down Expand Up @@ -81,6 +86,7 @@ runs:
INPUT_TFLINT_VERSION: ${{ inputs.tflint_version }}
INPUT_TFLINT_RULESETS: ${{ inputs.tflint_rulesets }}
INPUT_TFLINT_INIT: ${{ inputs.tflint_init }}
INPUT_TFLINT_TARGET_DIR: ${{ inputs.tflint_target_dir }}
INPUT_FLAGS: ${{ inputs.flags }}

branding:
Expand Down
2 changes: 1 addition & 1 deletion script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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} . \
TFLINT_PLUGIN_DIR=${TFLINT_PLUGIN_DIR} "${TFLINT_PATH}/tflint" --format=checkstyle ${INPUT_FLAGS} ${INPUT_TFLINT_TARGET_DIR} \
| "${REVIEWDOG_PATH}/reviewdog" -f=checkstyle \
-name="tflint" \
-reporter="${INPUT_REPORTER}" \
Expand Down