From e1f272d9c57c90c741d159f4bb691f672c091fac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A2=A8=E6=A2=93=E6=9F=92?= <1787882683@qq.com> Date: Sun, 13 Apr 2025 00:45:57 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0Ruff=20Action=20=E7=8E=B0?= =?UTF-8?q?=E5=9C=A8=E6=AF=8F=E4=B8=80=E4=B8=AA=E9=80=9A=E8=BF=87Ruff?= =?UTF-8?q?=E7=9A=84pr=E5=92=8Ccommit=E9=83=BD=E4=BC=9A=E8=87=AA=E5=8A=A8?= =?UTF-8?q?=E6=A0=BC=E5=BC=8F=E5=8C=96=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/ruff.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.github/workflows/ruff.yml b/.github/workflows/ruff.yml index 4d9fa6883..931624fb1 100644 --- a/.github/workflows/ruff.yml +++ b/.github/workflows/ruff.yml @@ -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