Skip to content

Commit eb0ea31

Browse files
committed
Add fail-on-warning option
1 parent b43ce79 commit eb0ea31

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

action.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@ inputs:
1919
comma-separated list of checks that will be promoted to errors.
2020
required: false
2121
default: ""
22+
fail-on-warning:
23+
description: ""
24+
required: false
25+
default: false
2226
extra-arg:
2327
description: |
2428
Additional argument to append to the compiler command line.
@@ -156,7 +160,12 @@ runs:
156160
run: |
157161
PATH=~/.local/clazy/bin:$PATH "$GITHUB_ACTION_PATH/clazy.sh"
158162
163+
- name: Exit if warning
164+
if: ${{ inputs.fail-on-warning == 'true' && steps.clazy-check.outputs.warnings-count > 0}}
165+
shell: bash
166+
run: exit 1
167+
159168
- name: Exit if error
160-
if: ${{steps.clazy-check.outputs.errors-count > 0 }}
169+
if: ${{ steps.clazy-check.outputs.errors-count > 0 }}
161170
shell: bash
162171
run: exit 1

0 commit comments

Comments
 (0)