-
Notifications
You must be signed in to change notification settings - Fork 1
42 lines (36 loc) · 1.23 KB
/
format-files.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
name: Format files with prettier and syncpack
on:
push:
branches:
- main
jobs:
format:
name: Format and commit files
runs-on: ubuntu-latest
if: github.actor != 'frachtbot'
steps:
- name: Checkout
uses: actions/checkout@v4
with:
token: ${{ secrets.BOT_GITHUB_TOKEN }}
- name: Use Node 20
uses: actions/setup-node@v4
with:
node-version: 20
- name: Install pnpm 9.12.3
uses: pnpm/action-setup@v4
with:
version: 9.12.3
- name: Install dependencies (with cache)
uses: covbot/pnpm-install-with-cache@v1
- name: Format files
run: pnpm run format
- name: Commit changed files
shell: bash
run: |
if [[ `git status --porcelain` ]]; then
git config --global user.name "frachtbot"
git config --global user.email "[email protected]"
git commit -am "[skip ci] Syncpack and prettier format"
git push
fi