Skip to content

Commit

Permalink
Added input for fail-level reviewdog flag to later replace deprecated…
Browse files Browse the repository at this point in the history
… fail-on-error reviewdog flag (#124)

* Replace deprecated fail-on-error flag with fail-level

* Restore fail-on-error flag

* Update doc with suggestions
  • Loading branch information
Bilka2 authored Dec 2, 2024
1 parent 4018bd7 commit ef7ea43
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 0 deletions.
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,15 @@ With `reporter: github-pr-review` a comment is added to the Pull Request Convers

<!-- Please maintain inputs in alphabetical order -->

### `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 is `false`.

Expand Down
9 changes: 9 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,19 @@ description: '🐶 Run rubocop with reviewdog on pull requests to improve code r
author: 'mgrachev (reviewdog)'
inputs:
# Please maintain inputs in alphabetical order
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: |
Deprecated, use `fail_level` instead.
Exit code for reviewdog when errors are found [true,false]
Default is `false`.
default: 'false'
deprecationMessage: Deprecated, use `fail_level` instead.
filter_mode:
description: |
Filtering mode for the reviewdog command [added,diff_context,file,nofilter].
Expand Down Expand Up @@ -63,6 +71,7 @@ runs:
# INPUT_<VARIABLE_NAME> is not available in Composite run steps
# https://github.community/t/input-variable-name-is-not-available-in-composite-run-steps/127611
# Please maintain inputs in alphabetical order
INPUT_FAIL_LEVEL: ${{ inputs.fail_level }}
INPUT_FAIL_ON_ERROR: ${{ inputs.fail_on_error }}
INPUT_FILTER_MODE: ${{ inputs.filter_mode }}
INPUT_GITHUB_TOKEN: ${{ inputs.github_token }}
Expand Down
1 change: 1 addition & 0 deletions script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ ${BUNDLE_EXEC}rubocop \
-name="${INPUT_TOOL_NAME}" \
-reporter="${INPUT_REPORTER}" \
-filter-mode="${INPUT_FILTER_MODE}" \
-fail-level="${INPUT_FAIL_LEVEL}" \
-fail-on-error="${INPUT_FAIL_ON_ERROR}" \
-level="${INPUT_LEVEL}" \
${INPUT_REVIEWDOG_FLAGS}
Expand Down

0 comments on commit ef7ea43

Please sign in to comment.