From e3ebc11228f6d48edf02017e3fa949d10512052f Mon Sep 17 00:00:00 2001 From: Bilka Date: Thu, 18 Jul 2024 19:39:25 +0200 Subject: [PATCH] Add fail-on-error input --- README.md | 5 +++++ action.yml | 4 ++++ script.sh | 3 ++- 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 75cd874..a7dfee4 100644 --- a/README.md +++ b/README.md @@ -15,6 +15,11 @@ code review experience. Optional. Report level for reviewdog [`info`, `warning`, `error`]. The default is `error`. +### `fail_on_error` + +Optional. Exit code 1 for reviewdog if it finds errors [`true`, `false`]. +The default is `false`. + ### `reporter` Optional. Reporter of reviewdog command [`github-pr-check`, `github-check`, `github-pr-review`]. diff --git a/action.yml b/action.yml index d1ae9fa..e063192 100644 --- a/action.yml +++ b/action.yml @@ -8,6 +8,9 @@ inputs: level: description: 'Report level for reviewdog [info,warning,error]' default: 'error' + fail_on_error: + description: 'Exit code 1 for reviewdog if it finds errors [true,false]' + default: 'false' reporter: description: | Reporter of reviewdog command [github-pr-check,github-check,github-pr-review]. @@ -29,6 +32,7 @@ runs: env: INPUT_GITHUB_TOKEN: ${{ inputs.github_token }} INPUT_LEVEL: ${{ inputs.level }} + INPUT_FAIL_ON_ERROR: ${{ inputs.fail_on_error }} INPUT_REPORTER: ${{ inputs.reporter }} INPUT_FILTER_MODE: ${{ inputs.filter_mode }} INPUT_USE_BUNDLER: ${{ inputs.use_bundler }} diff --git a/script.sh b/script.sh index 0a00f96..1315cc2 100755 --- a/script.sh +++ b/script.sh @@ -26,5 +26,6 @@ ${BUNDLE_EXEC}erblint --lint-all --format compact \ -efm="%f:%l:%c: %m" \ -reporter="${INPUT_REPORTER}" \ -filter-mode="${INPUT_FILTER_MODE}" \ - -level="${INPUT_LEVEL}" + -level="${INPUT_LEVEL}" \ + -fail-on-error="${INPUT_FAIL_ON_ERROR}" echo '::endgroup::'