From 3cc7738e2d46fb69de6074339f7f2b6808801589 Mon Sep 17 00:00:00 2001 From: Dmitriy Belyaev Date: Mon, 27 Jan 2025 13:38:58 +0100 Subject: [PATCH] docs: adjust docs and defaults --- README.md | 9 +++++---- action.yml | 6 +++--- entrypoint.sh | 2 +- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 4202b1d..68fc51c 100644 --- a/README.md +++ b/README.md @@ -180,14 +180,15 @@ config for the [Sun coding conventions](https://www.oracle.com/java/technologies * ### `fail_level` - Defines exit code of reviewdog run when it finds error(s). This can be useful in CI pipeline. - reviewdog will exist with code `1` when configured with `-fail-level=[any, info, warning, error]` and it finds at least 1 error. + The reviewdog tool gives you a way to tell your automated system (like a CI pipeline) if it has found any errors in your code. This is done using something known as an exit code. - Use `-fail-level=none` to make it always exit with `0`, even if it finds error. + By default (`-fail-level=none`), reviewdog will finish its run and give an exit code of `0`, which means everything is fine, even if it actually found some errors. + + But you can change this. If you use the `-fail-level` flag with `any`, `info`, `warning`, or `error`, reviewdog will finish with an exit code of `1` if it finds at least one problem with severity greater than or equal to the given level. This tells your automated system that there's something that needs attention (and you can trigger some actions, rules or events based on it). **`Values:`** `[none, any, info, warning, error]` - **`Default:`** `error` + **`Default:`** `none` * ### `reviewdog_flags` diff --git a/action.yml b/action.yml index b6f1dc0..ff30972 100644 --- a/action.yml +++ b/action.yml @@ -23,9 +23,9 @@ inputs: default: "added" fail_level: description: | - Exits code 1 when errors are found at that level or above. Options are [none,any,error,warning,info] - Default is `error`. - default: "error" + Exits code 1 when errors are found at that level or above. Options are [none, any, error, warning, info] + Default is `none`. + default: "none" reviewdog_flags: description: "Additional reviewdog flags" default: "" diff --git a/entrypoint.sh b/entrypoint.sh index 852da21..e105323 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -34,6 +34,6 @@ exec java -jar /opt/lib/checkstyle.jar "${INPUT_WORKDIR}" -c "${INPUT_CHECKSTYLE -name="checkstyle" \ -reporter="${INPUT_REPORTER:-github-pr-check}" \ -filter-mode="${INPUT_FILTER_MODE:-added}" \ - -fail-level="${INPUT_FAIL_LEVEL:-error}" \ + -fail-level="${INPUT_FAIL_LEVEL:-none}" \ -level="${INPUT_LEVEL}" \ "${INPUT_REVIEWDOG_FLAGS}" -