File tree Expand file tree Collapse file tree 1 file changed +21
-6
lines changed Expand file tree Collapse file tree 1 file changed +21
-6
lines changed Original file line number Diff line number Diff line change 11name : Check Formatting
2-
32on :
43 push :
54 branches :
65 - ep2025
76 pull_request :
8-
97jobs :
108 format-check :
119 runs-on : ubuntu-latest
1210 steps :
1311 - name : Checkout
1412 uses : actions/checkout@v4
15-
13+ with :
14+ token : ${{ secrets.COMMENT_TOKEN }}
15+
1616 - name : Set up pnpm
1717 uses : pnpm/action-setup@v4
1818 with :
1919 run_install : false
20-
20+
2121 - name : Set up Node.js
2222 uses : actions/setup-node@v4
2323 with :
2424 node-version : 20
2525 cache : " pnpm"
26-
26+
2727 - name : Install dependencies
2828 run : make install
29-
29+
3030 - name : Check Formatting
31+ id : format-check
3132 run : pnpm format --check
33+ continue-on-error : true
34+
35+ - name : Auto Format
36+ if : steps.format-check.outcome == 'failure'
37+ run : pnpm format
38+
39+ - name : Commit changes
40+ if : steps.format-check.outcome == 'failure'
41+ run : |
42+ git config --local user.email "github-actions[bot]@users.noreply.github.com"
43+ git config --local user.name "github-actions[bot]"
44+ git add .
45+ git commit -m "chore: auto-format code" -m "Automated code formatting."
46+ git push
You can’t perform that action at this time.
0 commit comments