Skip to content

Commit

Permalink
Merge pull request #75 from reviewdog/add_fail_level
Browse files Browse the repository at this point in the history
Add fail_level and deduplicate fail_on_error
  • Loading branch information
massongit authored Dec 3, 2024
2 parents 8bc2cae + c60dcb0 commit 6dbb2a0
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 1 deletion.
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,16 @@ 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
Expand Down
10 changes: 9 additions & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,16 @@ 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'
Expand Down
1 change: 1 addition & 0 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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=$?

Expand Down

0 comments on commit 6dbb2a0

Please sign in to comment.