-
Notifications
You must be signed in to change notification settings - Fork 28
59 lines (47 loc) · 1.43 KB
/
check_fix_push.yml
File metadata and controls
59 lines (47 loc) · 1.43 KB
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
name: check_fix_push
on:
push:
branches:
- '**'
permissions: write-all
env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
jobs:
check:
runs-on: ubuntu-latest
if: |
${{ github.event.head_commit.message!='chore(actions): check_format_lint' }}
steps:
- name: 检出仓库代码
uses: actions/checkout@v5
- name: 配置 Node.js 运行环境
uses: actions/setup-node@v5
with:
node-version: 25
package-manager-cache: false
- name: 启用 corepack 并安装 pnpm
run: |
corepack enable
corepack prepare pnpm@latest --activate
- name: 安装项目依赖
run: pnpm install
- name: 执行项目检查
run: pnpm run check
- name: 执行代码格式化
run: pnpm run format
- name: 执行代码静态检查
run: pnpm run lint
- name: 提交自动修复结果
id: commit
run: |
git config --local user.email github-actions[bot]@users.noreply.github.com
git config --local user.name github-actions[bot]
git status --porcelain
git --no-pager diff
git commit -a -m "chore(actions): check_format_lint"
continue-on-error: true
- name: 推送修复后的代码
uses: ad-m/github-push-action@master
if: ${{ steps.commit.outcome == 'success' }}
with:
branch: ${{ github.ref }}