From 9a8c4dbb9ff4edc0bd6db94c1294e41ec736a687 Mon Sep 17 00:00:00 2001 From: Masaya Suzuki Date: Tue, 3 Dec 2024 07:31:45 +0900 Subject: [PATCH 1/2] Add fail_level and deduplicate fail_on_error --- README.md | 7 +++++++ action.yml | 9 ++++++++- entrypoint.sh | 1 + 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 9b9550c..99bdf4a 100644 --- a/README.md +++ b/README.md @@ -74,8 +74,15 @@ 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..c829958 100644 --- a/action.yml +++ b/action.yml @@ -29,8 +29,15 @@ 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=$? From c60dcb0397c8b0ed60688629f02ababaeae30f99 Mon Sep 17 00:00:00 2001 From: Masaya Suzuki Date: Tue, 3 Dec 2024 08:53:08 +0900 Subject: [PATCH 2/2] Add line break --- README.md | 3 ++- action.yml | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 99bdf4a..930b185 100644 --- a/README.md +++ b/README.md @@ -76,7 +76,8 @@ Optional. Filtering mode for the reviewdog command [`added`,`diff_context`,`file ### `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. +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`. diff --git a/action.yml b/action.yml index c829958..3463ea9 100644 --- a/action.yml +++ b/action.yml @@ -31,7 +31,8 @@ inputs: 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. + 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'