Skip to content

Commit

Permalink
Add config file input
Browse files Browse the repository at this point in the history
We would like to the run the action several times, with different
configurations
  • Loading branch information
DuncSmith committed Jul 29, 2024
1 parent eda368e commit edc65fb
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 edc65fb

Please sign in to comment.