From e14fdbb0f5da4ad3243e322a61b1fafcfbbc0599 Mon Sep 17 00:00:00 2001 From: Sinspired <63581268+sinspired@users.noreply.github.com> Date: Sat, 7 Dec 2024 09:50:12 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20update=5Fhosts.yml?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/update_hosts.yml | 34 +++++++++++++++++++++++++----- 1 file changed, 29 insertions(+), 5 deletions(-) diff --git a/.github/workflows/update_hosts.yml b/.github/workflows/update_hosts.yml index 658b306..528b795 100644 --- a/.github/workflows/update_hosts.yml +++ b/.github/workflows/update_hosts.yml @@ -16,13 +16,37 @@ permissions: contents: write jobs: - formatting: + format-fix: runs-on: ubuntu-latest + steps: - - uses: actions/checkout@v2 - # Run reorder-python-imports + black formatter - - name: Black Code Formatter - uses: tdeboissiere/python-format-action@master + - name: Checkout code + uses: actions/checkout@v3 + + - name: Setup Python + uses: actions/setup-python@v4 + with: + python-version: '3.10' + + - name: Install formatting tools + run: | + pip install black flake8 isort + + - name: Run and fix formatting + run: | + black . + isort . + flake8 . + + # 提交修复的代码 + - name: Commit and push fixes + if: success() || failure() + run: | + git config --global user.name "GitHub Actions" + git config --global user.email "actions@github.com" + git add . + git commit -m "Fix formatting issues" || echo "No changes to commit" + git push update-hosts: runs-on: ubuntu-latest