Skip to content

Commit 33c9975

Browse files
committed
Create pre-commit check with Lint.yml
Signed-off-by: zz990099 <771647586@qq.com>
1 parent 08c751e commit 33c9975

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

.github/workflows/Lint.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: pre-commit Checks
2+
3+
on:
4+
pull_request: # 在 PR 时触发
5+
push: # 在推送代码到 main/master 分支时触发
6+
branches: [main, master]
7+
8+
jobs:
9+
pre-commit:
10+
name: Run pre-commit checks
11+
runs-on: ubuntu-latest # 使用 Ubuntu 环境
12+
13+
steps:
14+
- name: Checkout code
15+
uses: actions/checkout@v4 # 检出代码
16+
17+
- name: Set up Python
18+
uses: actions/setup-python@v5
19+
with:
20+
python-version: "3.10" # 指定 Python 版本
21+
22+
- name: Install pre-commit
23+
run: pip install pre-commit # 安装 pre-commit
24+
25+
- name: Run pre-commit checks
26+
run: pre-commit run --all-files # 运行所有检查

0 commit comments

Comments
 (0)