-
Notifications
You must be signed in to change notification settings - Fork 6
39 lines (32 loc) · 1.02 KB
/
Copy pathcode_formatting.yml
File metadata and controls
39 lines (32 loc) · 1.02 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
name: Code Formatting
on:
push:
branches: [main]
# Enables a button on Actions tab
workflow_dispatch:
jobs:
format:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 10.33.2
- name: Use Node.js from .nvmrc
uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
cache: pnpm
- run: pnpm install --frozen-lockfile
- run: pnpm run format
- name: Commit changes
run: |
git config user.name github-actions
git config user.email github-actions@github.com
git add --all
git commit -m "Automatic Code Formatting" || echo "No changes to commit"
git push