Skip to content

Commit 809e079

Browse files
authored
自动化代码重构
1 parent 1b247df commit 809e079

1 file changed

Lines changed: 36 additions & 0 deletions

File tree

.github/workflows/main.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Format files
2+
3+
on:
4+
push:
5+
branches: [ master ]
6+
pull_request:
7+
branches: [ master ]
8+
workflow_dispatch:
9+
10+
jobs:
11+
test-and-build:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v2
15+
with:
16+
persist-credentials: false
17+
fetch-depth: 0
18+
19+
- name: Install Prettier
20+
run: npm install --save-dev --save-exact prettier
21+
22+
- name: Format files
23+
run: prettier --write .
24+
25+
- name: Commit files
26+
run: |
27+
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
28+
git config --local user.name "github-actions[bot]"
29+
git add .
30+
git commit -m "代码重构 【Github Actions】"
31+
32+
- name: Push changes
33+
uses: ad-m/github-push-action@master
34+
with:
35+
github_token: ${{ secrets.GITHUB_TOKEN }}
36+
branch: ${{ github.ref }}

0 commit comments

Comments
 (0)