-
Notifications
You must be signed in to change notification settings - Fork 6
42 lines (35 loc) · 1.05 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
name: 'Format Code'
on:
push:
branches:
- main
env:
PBOT_GITHUB_TOKEN: ${{ secrets.PBOT_GITHUB_TOKEN }}
jobs:
format:
runs-on: ubuntu-latest
env:
NODE_OPTIONS: "--max_old_space_size=4096"
steps:
- name: 🔍 PBOT_GITHUB_TOKEN
if: env.PBOT_GITHUB_TOKEN == ''
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: echo "PBOT_GITHUB_TOKEN=${GITHUB_TOKEN}" >> $GITHUB_ENV
- name: Check out code using Git
uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}
# Needs access to push to main
token: ${{ env.PBOT_GITHUB_TOKEN }}
- name: Install Tools & Dependencies
uses: ./.github/actions/install
- name: Format code
run: pnpm run format
- name: Commit changes
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: '[ci] format'
branch: ${{ github.head_ref }}
commit_user_name: fredkbot
commit_user_email: [email protected]