Skip to content

Commit 6e257b8

Browse files
committed
feat: add fail on error flag
fix: invalid output name
1 parent 7674730 commit 6e257b8

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

action.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@ inputs:
1818
description: 'The version of prettier to install'
1919
required: false
2020
default: 'latest'
21+
fail_on_error:
22+
description: 'Whether the script should fail when linting errors are found'
23+
required: false
24+
default: true
2125

2226
outputs:
2327
prettier_output:
@@ -37,6 +41,12 @@ runs:
3741
shell: bash
3842
run: echo "::set-output name=prettier-output::$(prettier --list-different --config ${{ inputs.config_path }} --ignore-path ${{ inputs.ignore_path }} --no-error-on-unmatched-pattern ${{ inputs.file_pattern }})"
3943

44+
- name: Fail On Error
45+
id: fail-on-error
46+
if: steps.prettier-run.outputs.prettier-output != 0 && steps.prettier-run.outputs.prettier-output != '' && inputs.fail_on_error
47+
shell: bash
48+
run: exit 1
49+
4050
branding:
4151
icon: 'search'
4252
color: 'gray-dark'

0 commit comments

Comments
 (0)