Skip to content

Commit ccae5f3

Browse files
authored
chore: add prettier action (#1778)
1 parent 04e47e9 commit ccae5f3

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

.github/workflows/prettier.yml

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: prettier
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request_target:
8+
9+
jobs:
10+
format:
11+
permissions:
12+
contents: write
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Checkout Repository
16+
uses: actions/checkout@v4
17+
with:
18+
repository: ${{ github.event.pull_request.head.repo.full_name }}
19+
ref: ${{ github.head_ref }}
20+
- name: Set up Node.js
21+
uses: actions/setup-node@v3
22+
with:
23+
node-version: 18
24+
- name: Install Dependencies
25+
run: npm install
26+
- name: Run prettier
27+
run: npx prettier --write "**/*.{md,js,ts,php,sql}"
28+
- name: Commit changes
29+
uses: stefanzweifel/git-auto-commit-action@v5
30+
with:
31+
commit_message: "style: format code and docs with prettier"
32+
commit_user_name: idoocs
33+
commit_user_email: doocs-bot@outlook.com

0 commit comments

Comments
 (0)