-
Notifications
You must be signed in to change notification settings - Fork 3
37 lines (37 loc) · 1.04 KB
/
format.yml
File metadata and controls
37 lines (37 loc) · 1.04 KB
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
name: Lint and Format
on: [pull_request]
jobs:
prettier:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}
- uses: technote-space/get-diff-action@v6
with:
PATTERNS: |
**/*.{ts,tsx,js,jsx,json}
- uses: pnpm/action-setup@v4
with:
version: 10
- uses: actions/setup-node@v3
with:
node-version: 20
cache: "pnpm"
cache-dependency-path: |
frontend/pnpm-lock.yaml
backend/pnpm-lock.yaml
- name: Install dependencies
run: |
cd frontend && pnpm install --frozen-lockfile
cd ../backend && pnpm install --frozen-lockfile
- name: Run Prettier Format
run: |
pnpm dlx prettier --write ${{ env.GIT_DIFF_FILTERED }}
if: env.GIT_DIFF
- uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: Apply Prettier Change