diff --git a/README.md b/README.md index 4ada026..3fac372 100644 --- a/README.md +++ b/README.md @@ -82,8 +82,15 @@ The default is `github-pr-check`. Optional. Filtering mode for the reviewdog command [`added`, `diff_context`, `file`, `nofilter`]. Default is `added`. +### `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 for reviewdog when errors are found [`true`, `false`] Default is `false`. diff --git a/action.yml b/action.yml index 7a504f5..f18481d 100644 --- a/action.yml +++ b/action.yml @@ -30,10 +30,18 @@ inputs: Filtering mode for the reviewdog command [added,diff_context,file,nofilter]. Default is added. default: 'added' + 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: | + Deprecated, use `fail_level` instead. Exit code for reviewdog when errors are found [true,false] Default is `false`. + deprecationMessage: Deprecated, use `fail_level` instead. default: 'false' reviewdog_flags: description: 'Additional reviewdog flags' @@ -56,6 +64,7 @@ runs: INPUT_LEVEL: ${{ inputs.level }} INPUT_REPORTER: ${{ inputs.reporter }} INPUT_FILTER_MODE: ${{ inputs.filter_mode }} + INPUT_FAIL_LEVEL: ${{ inputs.fail_level }} INPUT_FAIL_ON_ERROR: ${{ inputs.fail_on_error }} INPUT_REVIEWDOG_FLAGS: ${{ inputs.reviewdog_flags }} branding: diff --git a/script.sh b/script.sh index e3b84e4..7e2052c 100755 --- a/script.sh +++ b/script.sh @@ -39,6 +39,7 @@ git ls-files --exclude='*Dockerfile*' --ignored --cached ${EXCLUDES} \ -name="${INPUT_TOOL_NAME}" \ -reporter="${INPUT_REPORTER}" \ -filter-mode="${INPUT_FILTER_MODE}" \ + -fail-level="${INPUT_FAIL_LEVEL}" \ -fail-on-error="${INPUT_FAIL_ON_ERROR}" \ -level="${INPUT_LEVEL}" \ ${INPUT_REVIEWDOG_FLAGS}