From a0859dce01cb11280048e117313db7542bd7566d Mon Sep 17 00:00:00 2001 From: Bilka Date: Wed, 12 Feb 2025 12:29:26 +0100 Subject: [PATCH] Add fail_level and deprecate fail_on_error --- README.md | 7 +++++++ action.yml | 12 +++++++++++- script.sh | 1 + 3 files changed, 19 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index a7dfee4..2c9df16 100644 --- a/README.md +++ b/README.md @@ -15,8 +15,15 @@ code review experience. Optional. Report level for reviewdog [`info`, `warning`, `error`]. The default is `error`. +### `fail_level` + +Optional. If set to `none`, always use exit code 0 for reviewdog. Otherwise, exit code 1 for reviewdog if it finds at least 1 issue with severity greater than or equal to the given level. +Possible values: [`none`, `any`, `info`, `warning`, `error`] +Default is `none`. + ### `fail_on_error` +Deprecated, use `fail_level` instead. Optional. Exit code 1 for reviewdog if it finds errors [`true`, `false`]. The default is `false`. diff --git a/action.yml b/action.yml index e063192..0fc7c2c 100644 --- a/action.yml +++ b/action.yml @@ -8,9 +8,18 @@ inputs: level: description: 'Report level for reviewdog [info,warning,error]' default: 'error' + fail_level: + description: | + If set to `none`, always use exit code 0 for reviewdog. Otherwise, exit code 1 for reviewdog if it finds at least 1 issue with severity greater than or equal to the given level. + Possible values: [none,any,info,warning,error] + Default is `none`. + default: 'none' fail_on_error: - description: 'Exit code 1 for reviewdog if it finds errors [true,false]' + description: | + Deprecated, use `fail_level` instead. + Exit code 1 for reviewdog if it finds errors [true,false] default: 'false' + deprecationMessage: Deprecated, use `fail_level` instead. reporter: description: | Reporter of reviewdog command [github-pr-check,github-check,github-pr-review]. @@ -32,6 +41,7 @@ runs: env: INPUT_GITHUB_TOKEN: ${{ inputs.github_token }} INPUT_LEVEL: ${{ inputs.level }} + INPUT_FAIL_LEVEL: ${{ inputs.fail_level }} INPUT_FAIL_ON_ERROR: ${{ inputs.fail_on_error }} INPUT_REPORTER: ${{ inputs.reporter }} INPUT_FILTER_MODE: ${{ inputs.filter_mode }} diff --git a/script.sh b/script.sh index 1315cc2..5b4ae09 100755 --- a/script.sh +++ b/script.sh @@ -27,5 +27,6 @@ ${BUNDLE_EXEC}erblint --lint-all --format compact \ -reporter="${INPUT_REPORTER}" \ -filter-mode="${INPUT_FILTER_MODE}" \ -level="${INPUT_LEVEL}" \ + -fail-level="${INPUT_FAIL_LEVEL}" \ -fail-on-error="${INPUT_FAIL_ON_ERROR}" echo '::endgroup::'