Skip to content

Commit

Permalink
Add fail_level and deprecate fail_on_error
Browse files Browse the repository at this point in the history
  • Loading branch information
Bilka2 committed Feb 12, 2025
1 parent eda368e commit a0859dc
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 1 deletion.
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,15 @@ code review experience.
Optional. Report level for reviewdog [`info`, `warning`, `error`].
The default is `error`.

### `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 1 for reviewdog if it finds errors [`true`, `false`].
The default is `false`.

Expand Down
12 changes: 11 additions & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,18 @@ inputs:
level:
description: 'Report level for reviewdog [info,warning,error]'
default: 'error'
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 1 for reviewdog if it finds errors [true,false]'
description: |
Deprecated, use `fail_level` instead.
Exit code 1 for reviewdog if it finds errors [true,false]
default: 'false'
deprecationMessage: Deprecated, use `fail_level` instead.
reporter:
description: |
Reporter of reviewdog command [github-pr-check,github-check,github-pr-review].
Expand All @@ -32,6 +41,7 @@ runs:
env:
INPUT_GITHUB_TOKEN: ${{ inputs.github_token }}
INPUT_LEVEL: ${{ inputs.level }}
INPUT_FAIL_LEVEL: ${{ inputs.fail_level }}
INPUT_FAIL_ON_ERROR: ${{ inputs.fail_on_error }}
INPUT_REPORTER: ${{ inputs.reporter }}
INPUT_FILTER_MODE: ${{ inputs.filter_mode }}
Expand Down
1 change: 1 addition & 0 deletions script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,6 @@ ${BUNDLE_EXEC}erblint --lint-all --format compact \
-reporter="${INPUT_REPORTER}" \
-filter-mode="${INPUT_FILTER_MODE}" \
-level="${INPUT_LEVEL}" \
-fail-level="${INPUT_FAIL_LEVEL}" \
-fail-on-error="${INPUT_FAIL_ON_ERROR}"
echo '::endgroup::'

0 comments on commit a0859dc

Please sign in to comment.