Skip to content

Commit

Permalink
Add tflint Target Directory Parameter (#59)
Browse files Browse the repository at this point in the history
* Add a tflint_target_dir optional variable

* Use INPUT_TFLINT_TARGET_DIR in tflint command
  • Loading branch information
jw-maynard committed Oct 29, 2022
1 parent 9e5d83f commit 9a32252
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
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

0 comments on commit 9a32252

Please sign in to comment.