-
Notifications
You must be signed in to change notification settings - Fork 51
46 lines (43 loc) · 1.14 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
41
42
43
44
45
46
name: Format
on:
push:
branches: [main]
workflow_dispatch:
pull_request:
branches: [main]
permissions:
contents: write
pull-requests: write
jobs:
format:
runs-on: ubuntu-latest
name: Format Files
steps:
- uses: actions/create-github-app-token@v1
id: app-token
with:
app-id: ${{ secrets.APP_ID }}
private-key: ${{ secrets.APP_PRIVATE_KEY }}
- uses: actions/checkout@v4
with:
token: ${{ steps.app-token.outputs.token }}
- uses: pnpm/action-setup@v4
- name: Setup Node
uses: actions/setup-node@v4
with:
cache: "pnpm"
check-latest: true
registry-url: "https://registry.npmjs.org"
node-version: latest
- name: Install dependencies
run: |
corepack enable
pnpm install
- name: Format
run: pnpm format
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- uses: stefanzweifel/git-auto-commit-action@v5
if: github.event_name == 'push' || github.event_name == 'workflow_dispatch'
with:
commit_message: "chore: format"