From 9543997a0f5033286cfa134e35118b8701f352a7 Mon Sep 17 00:00:00 2001 From: Masaya Suzuki Date: Mon, 2 Dec 2024 22:21:55 +0900 Subject: [PATCH] Add fail_level and deduplicate fail_on_error --- README.md | 7 +++++++ action.yml | 8 ++++++++ entrypoint.sh | 1 + 3 files changed, 16 insertions(+) diff --git a/README.md b/README.md index 0380b95..1d880bf 100644 --- a/README.md +++ b/README.md @@ -54,8 +54,15 @@ It's same as `-reporter` flag of reviewdog. Optional. Filtering mode for the reviewdog command [added,diff_context,file,nofilter]. Default is 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. +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 b1f5d06..7d0498a 100644 --- a/action.yml +++ b/action.yml @@ -27,10 +27,18 @@ inputs: Default is file. default: 'file' required: true + 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' required: true reviewdog_flags: diff --git a/entrypoint.sh b/entrypoint.sh index 9092aa3..ba99b58 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -18,6 +18,7 @@ actionlint -oneline ${INPUT_ACTIONLINT_FLAGS} \ -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}