-
Notifications
You must be signed in to change notification settings - Fork 1
41 lines (33 loc) · 995 Bytes
/
code-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
# This action will run the code formatter once a pull request is closed that targets main
name: Code Formatter
on:
pull_request:
types:
- closed
branches: ['main']
env:
NODE_VERSION: '18.13.0'
jobs:
if_merged:
if: github.event.pull_request.merged == true
name: Install packages and format code
runs-on: ubuntu-latest
continue-on-error: true
steps:
- uses: actions/checkout@v3
with:
token: ${{ secrets.BOT_ACCESS_TOKEN }}
- name: Use Node.js ${{ env.NODE_VERSION }}
uses: actions/setup-node@v1
with:
node-version: ${{ env.NODE_VERSION }}
- name: Install
run: npm install
- name: Format Code
run: npx prettier . --write
- name: Commit
run: |
git config --global user.email "[email protected]"
git config --global user.name GCCollab Bot
git commit -a -m "Code formatting ${{ vars.IGNORE_DEPLOY }}"
git push