forked from Monday-Morning/project-reclamation
-
Notifications
You must be signed in to change notification settings - Fork 0
62 lines (55 loc) · 1.54 KB
/
prettier.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
50
51
52
53
54
55
56
57
58
59
60
61
62
name: Prettier Check
on:
workflow_call:
inputs:
file_pattern:
required: true
type: string
config_path:
required: true
type: string
ignore_path:
required: true
type: string
fail_on_error:
required: true
type: boolean
jobs:
prettier:
name: Prettier Check
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v2
- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: "14"
cache: "yarn"
cache-dependency-path: "**/yarn.lock"
- name: Use Actions Dev Cache
uses: actions/cache@v2
id: yarn-dev-cache
with:
path: "**/node_modules"
key: ${{ runner.os }}-dev-modules-${{ hashFiles('**/yarn.lock') }}
- name: Install Dev Dependencies
if: steps.yarn-dev-cache.outputs.cache-hit != 'true'
run: |
yarn install
cd server
yarn install
- name: Run Prettier
id: prettier-run
uses: rutajdash/[email protected]
with:
file_pattern: ${{ inputs.file_pattern }}
config_path: ${{ inputs.config_path }}
ignore_path: ${{ inputs.ignore_path }}
fail_on_error: ${{ inputs.fail_on_error }}
- name: Prettier Output
if: ${{ failure() }}
shell: bash
run: |
echo "The following files are not formatted:"
echo "${{ steps.prettier-run.outputs.prettier_output }}"