Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add fail_level and deduplicate fail_on_error #64

Merged
merged 1 commit into from
Dec 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,15 @@ The default is `github-pr-check`.
Optional. Filtering mode for the reviewdog command [`added`, `diff_context`, `file`, `nofilter`].
Default is `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 is `false`.

Expand Down
9 changes: 9 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,18 @@ 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 Expand Up @@ -57,6 +65,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_WORKDIR: ${{ inputs.workdir }}
Expand Down
1 change: 1 addition & 0 deletions script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ reviewdog < "$BRAKEMAN_REPORT_FILE" \
-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