From c705c6f7f1ee622b97ea40105bb70115e043a846 Mon Sep 17 00:00:00 2001 From: Duncan Smith Date: Thu, 16 Oct 2025 16:19:15 +0100 Subject: [PATCH 1/2] Add support for custom tool names Since https://github.com/reviewdog/reviewdog/pull/1804, If you run multiple instances of this action there is a risk pr comments created by one are deleted by another. By providing a different name, we should not see this happen --- action.yml | 4 ++++ script.sh | 7 +++++++ 2 files changed, 11 insertions(+) diff --git a/action.yml b/action.yml index c973904..39aefe5 100644 --- a/action.yml +++ b/action.yml @@ -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' @@ -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 diff --git a/script.sh b/script.sh index 41dd3d1..9cd510a 100755 --- a/script.sh +++ b/script.sh @@ -26,6 +26,12 @@ 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 \ @@ -33,6 +39,7 @@ ${BUNDLE_EXEC}erblint --lint-all --format compact ${CONFIG_FILE} \ -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::' From 55eff0db92f85de6811dd9d1da11dd05657c1b1d Mon Sep 17 00:00:00 2001 From: Duncan Smith Date: Mon, 20 Oct 2025 14:22:36 +0100 Subject: [PATCH 2/2] Update readme, add tool_name to docs --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index 2c9df16..4e95d48 100644 --- a/README.md +++ b/README.md @@ -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