Skip to content

Commit

Permalink
Merge pull request #19 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 1a8ed27 + 8dac698 commit 2e6b919
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:
reporter: github-pr-review
level: error
filter_mode: file
fail_on_error: true
fail_level: any
- name: check the exit code
if: ${{ !success() }}
run: echo 'The previous step should fail' && exit 1
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,19 @@ inputs:
Filtering mode for the reviewdog command [added,diff_context,file,nofilter].
Default is added.
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: |
Deprecated, use `fail_level` instead.
Exit code for reviewdog when errors are found [true,false].
Default is `false`.
deprecationMessage: Deprecated, use `fail_level` instead.
default: 'false'
reviewdog_flags:
description: 'Additional reviewdog flags.'
Expand Down
10 changes: 10 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,19 @@ inputs:
Filtering mode for the reviewdog command [added,diff_context,file,nofilter].
Default is added.
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: |
Deprecated, use `fail_level` instead.
Exit code for reviewdog when errors are found [true,false].
Default is `false`.
deprecationMessage: Deprecated, use `fail_level` instead.
default: 'false'
reviewdog_flags:
description: 'Additional reviewdog flags.'
Expand All @@ -52,6 +61,7 @@ runs:
INPUT_LEVEL: ${{ inputs.level }}
INPUT_REPORTER: ${{ inputs.reporter }}
INPUT_FILTER_MODE: ${{ inputs.filter_mode }}
INPUT_FAIL_LEVEL: ${{ inputs.fail_level }}
INPUT_FAIL_ON_ERROR: ${{ inputs.fail_on_error }}
INPUT_REVIEWDOG_FLAGS: ${{ inputs.reviewdog_flags }}
INPUT_TYPOS_FLAGS: ${{ inputs.typos_flags }}
Expand Down
1 change: 1 addition & 0 deletions script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ typos ${INPUT_TYPOS_FLAGS} --format json |
-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}" \
-tee \
Expand Down

0 comments on commit 2e6b919

Please sign in to comment.