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

Only specify Chdir command if it is needed #73

Merged
merged 1 commit into from
Jun 16, 2023
Merged
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
12 changes: 11 additions & 1 deletion script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,18 @@ echo '::group:: Running tflint with reviewdog 🐶 ...'
# Allow failures now, as reviewdog handles them
set +Eeuo pipefail


# We only want to specify the tflint target directory if it is not the default to avoid conflicts
CHDIR_COMMAND=""
if [ "$INPUT_TFLINT_TARGET_DIR" == "." ]; then
echo "Using default working directory. No need to specify chdir"
else
echo "Custom target directory specified."
CHDIR_COMMAND="--chdir=${INPUT_TFLINT_TARGET_DIR}"
fi

# shellcheck disable=SC2086
TFLINT_PLUGIN_DIR=${TFLINT_PLUGIN_DIR} "${TFLINT_PATH}/tflint" -c "${INPUT_TFLINT_CONFIG}" --format=checkstyle ${INPUT_FLAGS} --chdir=${INPUT_TFLINT_TARGET_DIR} \
TFLINT_PLUGIN_DIR=${TFLINT_PLUGIN_DIR} "${TFLINT_PATH}/tflint" -c "${INPUT_TFLINT_CONFIG}" --format=checkstyle ${INPUT_FLAGS} ${CHDIR_COMMAND} \
mitchellharvey97 marked this conversation as resolved.
Show resolved Hide resolved
| "${REVIEWDOG_PATH}/reviewdog" -f=checkstyle \
-name="tflint" \
-reporter="${INPUT_REPORTER}" \
Expand Down