Skip to content

Commit

Permalink
replace deprecated option with fail_level
Browse files Browse the repository at this point in the history
  • Loading branch information
bitcoin-tools committed Oct 8, 2024
1 parent e26ea73 commit f61f30c
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:
github_token: ${{ secrets.github_token }}
reporter: github-pr-review
level: error
fail_on_error: true
fail_level: any
- name: check the exit code
if: ${{ !success() }}
run: echo 'The previous step should fail' && exit 1
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ This action runs [Linkspector](https://github.com/UmbrellaDocs/linkspector) with
with:
github_token: ${{ secrets.github_token }}
reporter: github-pr-review
fail_on_error: true
fail_level: any
```
## Action inputs
Expand Down Expand Up @@ -58,10 +58,10 @@ For more details, see [Reporters](https://github.com/reviewdog/reviewdog?tab=rea

For more details, please see [Filter mode support table](https://github.com/reviewdog/reviewdog?tab=readme-ov-file#filter-mode-support-table).

### `fail_on_error`
### `fail_level`

(Optional) Exit code for reviewdog when errors are found [true,false]
Default is `false`.
(Optional) Exit code for reviewdog when errors are found with severity greater than or equal to the given level [none,any,info,warning,error].
Default is `none`.

### `reviewdog_flags`

Expand Down
11 changes: 5 additions & 6 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,10 @@ inputs:
Filtering mode for the reviewdog command [added,diff_context,file,nofilter].
Default is added.
default: 'added'
fail_on_error:
description: |
Exit code for reviewdog when errors are found [true,false].
Default is `false`.
default: 'false'
fail_level:
Exit code for reviewdog when errors are found with severity greater than or equal to the given level [none,any,info,warning,error].
Default is `none`.
default: 'none'
reviewdog_flags:
description: 'Additional reviewdog flags.'
default: ''
Expand All @@ -54,7 +53,7 @@ runs:
INPUT_LEVEL: ${{ inputs.level }}
INPUT_REPORTER: ${{ inputs.reporter }}
INPUT_FILTER_MODE: ${{ inputs.filter_mode }}
INPUT_FAIL_ON_ERROR: ${{ inputs.fail_on_error }}
INPUT_FAIL_LEVEL: ${{ inputs.fail_level }}
INPUT_REVIEWDOG_FLAGS: ${{ inputs.reviewdog_flags }}
INPUT_CONFIG_FILE: ${{ inputs.config_file }}
branding:
Expand Down
2 changes: 1 addition & 1 deletion script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ linkspector check -c "${INPUT_CONFIG_FILE}" -j |
-name="${INPUT_TOOL_NAME}" \
-reporter="${INPUT_REPORTER}" \
-filter-mode="${INPUT_FILTER_MODE}" \
-fail-on-error="${INPUT_FAIL_ON_ERROR}" \
-fail-level="${INPUT_FAIL_LEVEL}" \
-level="${INPUT_LEVEL}" \
"${INPUT_REVIEWDOG_FLAGS}"
exit_code=$?
Expand Down

0 comments on commit f61f30c

Please sign in to comment.