Skip to content
Open
Show file tree
Hide file tree
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
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,12 @@ Optional. Do not install Rubocop or its extensions. Default: `false`.

Optional. Run Rubocop with bundle exec. Default: `false`.

### `tool_name`

Optional. Tool name to be displayed in the reviewdog comment.
Useful when you have multiple linters running in a single workflow.
Default: `erb-lint`.

## Example usage

```yml
Expand Down
4 changes: 4 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ inputs:
Config file to pass to erb-lint.
Default is .erb-lint.yml.
default: '.erb-lint.yml'
tool_name:
description: 'Tool name to be displayed in the reviewdog comment. Default: `erb-lint`'
default: 'erb-lint'

runs:
using: 'composite'
Expand All @@ -53,6 +56,7 @@ runs:
INPUT_FILTER_MODE: ${{ inputs.filter_mode }}
INPUT_USE_BUNDLER: ${{ inputs.use_bundler }}
INPUT_CONFIG_FILE: ${{ inputs.config_file }}
INPUT_TOOL_NAME: ${{ inputs.tool_name }}
branding:
icon: check-circle
color: blue
7 changes: 7 additions & 0 deletions script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,20 @@ else
CONFIG_FILE="--config=${INPUT_CONFIG_FILE}"
fi

if [ -z "${INPUT_TOOL_NAME}" ]; then
TOOL_NAME="erb-lint"
else
TOOL_NAME="${INPUT_TOOL_NAME}"
fi

echo '::group:: Running erb-lint with reviewdog 🐶 ...'
${BUNDLE_EXEC}erblint --lint-all --format compact ${CONFIG_FILE} \
| reviewdog \
-efm="%f:%l:%c: %m" \
-reporter="${INPUT_REPORTER}" \
-filter-mode="${INPUT_FILTER_MODE}" \
-level="${INPUT_LEVEL}" \
-name="${TOOL_NAME}" \
-fail-level="${INPUT_FAIL_LEVEL}" \
-fail-on-error="${INPUT_FAIL_ON_ERROR}"
echo '::endgroup::'