Files
Mofox-Core/.github/workflows/ruff.yml
ChangingSelf 99b755f424 ci/github-actions: update ruff job to handle specific refs
- Set fetch-depth to 0 to fetch the entire history
- Add ref input to checkout specific branch or tag
2025-04-13 21:07:53 +08:00

27 lines
714 B
YAML

name: Ruff
on: [ push, pull_request ]
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 }}
- uses: astral-sh/ruff-action@v3
- 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