Skip to content

Commit

Permalink
docs: adjust docs and defaults
Browse files Browse the repository at this point in the history
  • Loading branch information
dbelyaev committed Jan 27, 2025
1 parent afb4edc commit 3cc7738
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`

Expand Down
6 changes: 3 additions & 3 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: ""
Expand Down
2 changes: 1 addition & 1 deletion entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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}" -

0 comments on commit 3cc7738

Please sign in to comment.