Files
Mofox-Core/.github/workflows/ruff.yml
墨梓柒 6f03b29bd0 ci(workflows): 分离Ruff的push和pull_request触发条件
将Ruff的触发条件从同时监听push和pull_request改为分别监听,以优化CI流程并减少不必要的构建
2025-04-20 01:04:43 +08:00

30 lines
791 B
YAML

name: Ruff
on: [ push ]
permissions:
contents: write
jobs:
ruff:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ github.head_ref || github.ref_name }}
- name: Install the latest version of ruff
uses: astral-sh/ruff-action@v3
with:
version: "latest"
- run: ruff check --fix
- run: ruff format
- name: Commit changes
if: success()
run: |
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git add -A
git diff --quiet && git diff --staged --quiet || git commit -m "🤖 自动格式化代码 [skip ci]"
git push