diff --git a/README.md b/README.md index 9b9550c..930b185 100644 --- a/README.md +++ b/README.md @@ -74,8 +74,16 @@ exclude: | Optional. Filtering mode for the reviewdog command [`added`,`diff_context`,`file`,`nofilter`]. Default: `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: `false`. ## Example usage diff --git a/action.yml b/action.yml index 8ea9f57..3463ea9 100644 --- a/action.yml +++ b/action.yml @@ -29,8 +29,16 @@ inputs: filter_mode: description: "Filtering mode for the reviewdog command [added,diff_context,file,nofilter]." 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: "Exit code for reviewdog when errors are found [true,false]." + description: "Deprecated, use `fail_level` instead. Exit code for reviewdog when errors are found [true,false]." + deprecationMessage: Deprecated, use `fail_level` instead. default: 'false' runs: using: 'docker' diff --git a/entrypoint.sh b/entrypoint.sh index 8fcea67..f9d9420 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -31,6 +31,7 @@ find "${paths[@]}" "${excludes[@]}" -type f "${names[@]}" -print0 \ -name="misspell" \ -reporter="${INPUT_REPORTER:-github-pr-check}" \ -level="${INPUT_LEVEL}" \ + -fail-level="${INPUT_FAIL_LEVEL}" \ -fail-on-error="${INPUT_FAIL_ON_ERROR}" exit_code=$?