Skip to content

Commit

Permalink
Add fail_level and deduplicate fail_on_error
Browse files Browse the repository at this point in the history
  • Loading branch information
massongit committed Dec 2, 2024
1 parent ef8b22c commit 9a8c4db
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,15 @@ 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
9 changes: 8 additions & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,15 @@ 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 9a8c4db

Please sign in to comment.