-
Notifications
You must be signed in to change notification settings - Fork 3
43 lines (35 loc) · 996 Bytes
/
format.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
name: Format Code
on:
pull_request:
branches: [main]
jobs:
format-code:
runs-on: ubuntu-latest
permissions:
contents: write
strategy:
max-parallel: 1
matrix:
directory: ["packages/app", "packages/docs", "packages/proxy"]
steps:
- name: Checkout
uses: actions/checkout@v3
with:
ref: ${{ github.head_ref }}
fetch-depth: 0
- name: Setup NodeJS
uses: actions/setup-node@v3
with:
node-version: "16"
cache: "npm"
cache-dependency-path: ${{ matrix.directory }}/package-lock.json
- name: Install package dependencies
working-directory: ${{ matrix.directory }}
run: npm install
- name: Run format command
working-directory: ${{ matrix.directory }}
run: npm run format
- name: Commit changes
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: "ci: auto-format"