mirror of https://github.com/Mai-with-u/MaiBot.git
feat: 更新 Ruff 工作流,仅在对分支的push时启动Ruff检查
parent
344a8baf22
commit
7acee94ee4
|
|
@ -1,5 +1,12 @@
|
||||||
name: Ruff
|
name: Ruff
|
||||||
on: [ push ]
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
- dev
|
||||||
|
- dev-refactor # 例如:匹配所有以 feature/ 开头的分支
|
||||||
|
# 添加你希望触发此 workflow 的其他分支
|
||||||
|
|
||||||
permissions:
|
permissions:
|
||||||
contents: write
|
contents: write
|
||||||
|
|
@ -7,6 +14,10 @@ permissions:
|
||||||
jobs:
|
jobs:
|
||||||
ruff:
|
ruff:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
# 关键修改:添加条件判断
|
||||||
|
# 确保只有在 event_name 是 'push' 且不是由 Pull Request 引起的 push 时才运行
|
||||||
|
if: github.event_name == 'push' && !startsWith(github.ref, 'refs/pull/')
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
|
|
@ -26,4 +37,3 @@ jobs:
|
||||||
git add -A
|
git add -A
|
||||||
git diff --quiet && git diff --staged --quiet || git commit -m "🤖 自动格式化代码 [skip ci]"
|
git diff --quiet && git diff --staged --quiet || git commit -m "🤖 自动格式化代码 [skip ci]"
|
||||||
git push
|
git push
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue