-
Notifications
You must be signed in to change notification settings - Fork 0
41 lines (35 loc) · 1.1 KB
/
Copy pathprettier.yml
File metadata and controls
41 lines (35 loc) · 1.1 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
38
39
40
41
name: Prettier (non-main)
on:
push:
branches-ignore: [main]
pull_request:
branches-ignore: [main]
jobs:
prettier:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- name: Checkout repository
uses: actions/checkout@v6
with:
# On push → github.ref_name (branch)
# On PR → github.head_ref (source branch)
ref: ${{ github.head_ref || github.ref_name }}
token: ${{ secrets.GITHUB_TOKEN }}
- name: Setup workspace
uses: ./.github/actions/setup-workspace
with:
build-workspace: 'false'
- name: Run Prettier
run: pnpm prettier --write .
# Only commit and push on push events, not on pull_request
- name: Commit changes
if: github.event_name == 'push'
run: |
git config --global user.name 'GitHub Actions'
git config --global user.email 'actions@github.com'
git add -A
git diff --quiet && git diff --staged --quiet || git commit -m "Apply Prettier formatting"
git push