diff --git a/action.yml b/action.yml index a867f19..cc4e764 100644 --- a/action.yml +++ b/action.yml @@ -33,6 +33,9 @@ inputs: workdir: description: "The directory from which to look for and run eslint. Default '.'" default: '.' + tool_name: + description: 'Tool name to use for reviewdog reporter' + default: 'eslint' runs: using: 'docker' image: 'Dockerfile' diff --git a/entrypoint.sh b/entrypoint.sh index b30816a..16b2235 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -17,7 +17,7 @@ if [ "${INPUT_REPORTER}" == 'github-pr-review' ]; then $(npm bin)/eslint -f="json" ${INPUT_ESLINT_FLAGS:-'.'} \ | jq -r '.[] | {filePath: .filePath, messages: .messages[]} | "\(.filePath):\(.messages.line):\(.messages.column):\(.messages.message) [\(.messages.ruleId)](https://eslint.org/docs/rules/\(.messages.ruleId))"' \ | reviewdog -efm="%f:%l:%c:%m" \ - -name="eslint" \ + -name="${INPUT_TOOL_NAME}" \ -reporter=github-pr-review \ -filter-mode="${INPUT_FILTER_MODE}" \ -fail-on-error="${INPUT_FAIL_ON_ERROR}" \ @@ -27,6 +27,7 @@ else # github-pr-check,github-check (GitHub Check API) doesn't support markdown annotation. $(npm bin)/eslint -f="stylish" ${INPUT_ESLINT_FLAGS:-'.'} \ | reviewdog -f="eslint" \ + -name="${INPUT_TOOL_NAME}" \ -reporter="${INPUT_REPORTER:-github-pr-check}" \ -filter-mode="${INPUT_FILTER_MODE}" \ -fail-on-error="${INPUT_FAIL_ON_ERROR}" \