From 9a76e4644450639487222c281aceeeee3a5c1224 Mon Sep 17 00:00:00 2001 From: Masaya Suzuki Date: Tue, 3 Dec 2024 07:25:26 +0900 Subject: [PATCH] Add fail_level and deduplicate fail_on_error --- README.md | 8 ++++++++ action.yml | 8 ++++++++ entrypoint.sh | 1 + 3 files changed, 17 insertions(+) diff --git a/README.md b/README.md index 81c21a6..1fb221f 100644 --- a/README.md +++ b/README.md @@ -35,10 +35,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' diff --git a/action.yml b/action.yml index c191cc5..21eafa3 100644 --- a/action.yml +++ b/action.yml @@ -20,10 +20,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' diff --git a/entrypoint.sh b/entrypoint.sh index 199163d..8a0e241 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -19,6 +19,7 @@ jq -f /gitleaks-to-rdjson.jq -c "$TEMP_FILE" \ -name="gitleaks" \ -reporter="${INPUT_REPORTER:-github-pr-check}" \ -filter-mode="${INPUT_FILTER_MODE}" \ + -fail-level="${INPUT_FAIL_LEVEL}" \ -fail-on-error="${INPUT_FAIL_ON_ERROR}" \ -level="${INPUT_LEVEL}" \ ${INPUT_REVIEWDOG_FLAGS}