forked from rutajdash/prettier-cli-action
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaction.yml
49 lines (45 loc) · 1.34 KB
/
action.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
name: 'Prettier Check'
author: 'Rutaj Dash'
description: 'A simple action which runs the Prettier CLI Check'
inputs:
file_pattern:
description: 'The file pattern to scan'
required: false
default: '**/*.js'
config_path:
description: 'The path to the prettierrc file'
required: false
default: ''
ignore_path:
description: 'The path to the prettierignore file'
required: false
default: './.prettierignore'
prettier_version:
description: 'The version of prettier to install'
required: false
default: 'latest'
fail_on_error:
description: 'Whether the script should fail when linting errors are found'
required: false
default: true
outputs:
prettier_output:
description: 'The output from prettier'
value: ${{ steps.prettier-run.outputs.prettier-output }}
runs:
using: 'composite'
steps:
- name: Installing Prettier
id: prettier-install
shell: bash
run: |
npm install --global prettier@${{ inputs.prettier_version }}
echo "prettier version: $(prettier --version)"
- name: Running Prettier
id: prettier-run
shell: bash
run: |
prettier --check --config ${{ inputs.config_path }} --ignore-path ${{ inputs.ignore_path }} --no-error-on-unmatched-pattern "${{ inputs.file_pattern }}"
branding:
icon: 'search'
color: 'gray-dark'