Skip to content

Commit

Permalink
Merge pull request #2 from fac/add-config-input
Browse files Browse the repository at this point in the history
Add config file input
  • Loading branch information
tk0miya authored Jul 29, 2024
2 parents eda368e + edc65fb commit b6e537f
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
7 changes: 7 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
8 changes: 7 additions & 1 deletion script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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}" \
Expand Down

0 comments on commit b6e537f

Please sign in to comment.