diff --git a/action.yml b/action.yml index e063192..2f316e4 100644 --- a/action.yml +++ b/action.yml @@ -24,6 +24,12 @@ inputs: use_bundler: description: "Run erb-lint with bundle exec. Default: `false`" default: 'false' + config_file: + description: | + Config file to pass to erb-lint. + Default is .erb-lint.yml. + default: '.erb-lint.yml' + runs: using: 'composite' steps: @@ -36,6 +42,7 @@ runs: INPUT_REPORTER: ${{ inputs.reporter }} INPUT_FILTER_MODE: ${{ inputs.filter_mode }} INPUT_USE_BUNDLER: ${{ inputs.use_bundler }} + INPUT_CONFIG_FILE: ${{ inputs.config_file }} branding: icon: check-circle color: blue diff --git a/script.sh b/script.sh index 1315cc2..ee895b1 100755 --- a/script.sh +++ b/script.sh @@ -20,8 +20,14 @@ else BUNDLE_EXEC="bundle exec " fi +if [ -z "${INPUT_CONFIG_FILE}" ]; then + CONFIG_FILE="--config=.erb-lint.yml" +else + CONFIG_FILE="--config=${INPUT_CONFIG_FILE}" +fi + echo '::group:: Running erb-lint with reviewdog 🐶 ...' -${BUNDLE_EXEC}erblint --lint-all --format compact \ +${BUNDLE_EXEC}erblint --lint-all --format compact ${CONFIG_FILE} \ | reviewdog \ -efm="%f:%l:%c: %m" \ -reporter="${INPUT_REPORTER}" \