-
Notifications
You must be signed in to change notification settings - Fork 1
40 lines (39 loc) · 1.23 KB
/
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
name: format code
on:
pull_request:
branches:
- main
jobs:
format-frontend:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./frontend
steps:
- uses: actions/checkout@v4
if: github.event.pull_request.head.repo.full_name == github.repository
with:
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ github.event.pull_request.head.ref }}
token: ${{ secrets.MONDEY_FORMAT_BOT_PAT }}
- uses: actions/checkout@v4
if: github.event.pull_request.head.repo.full_name != github.repository
with:
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ github.event.pull_request.head.ref }}
- uses: pnpm/action-setup@v4
with:
version: 9
- uses: actions/setup-node@v4
with:
node-version: 22
cache: 'pnpm'
cache-dependency-path: frontend/pnpm-lock.yaml
- run: pnpm install
- run: pnpm format
- uses: EndBug/add-and-commit@v9
with:
add: "*"
author_name: "github-actions[bot]"
author_email: "github-actions[bot]@users.noreply.github.com"
message: "pnpm format"