-
Notifications
You must be signed in to change notification settings - Fork 1
39 lines (33 loc) · 1 KB
/
check-prettified.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
name: check-prettified
run-name: Checking code is prettified
on: [push]
jobs:
check-prettified:
strategy:
matrix:
path: ["client", "server"]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: technote-space/get-diff-action@v6
id: get-diff
with:
PATTERNS: |
.github/**/*
${{ matrix.path }}/**/*
- uses: actions/setup-node@v3
with:
cache-dependency-path: ${{ matrix.path }}/package-lock.json
if: steps.get-diff.outputs.diff
- run: npm ci
if: steps.get-diff.outputs.diff
working-directory: ${{ matrix.path }}
- run: npm run format
if: steps.get-diff.outputs.diff
working-directory: ${{ matrix.path }}
- run: |
if [[ $(git diff --name-only) ]]; then
echo "**'${{ matrix.path }}' is not formatted. Please run 'npm run format' before push**"
exit 1
fi
if: steps.get-diff.outputs.diff