更新Ruff Action
现在每一个通过Ruff的pr和commit都会自动格式化代码
This commit is contained in:
12
.github/workflows/ruff.yml
vendored
12
.github/workflows/ruff.yml
vendored
@@ -1,5 +1,9 @@
|
||||
name: Ruff
|
||||
on: [ push, pull_request ]
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
jobs:
|
||||
ruff:
|
||||
runs-on: ubuntu-latest
|
||||
@@ -8,4 +12,12 @@ jobs:
|
||||
- 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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user