From ffec2b4c52833927e197d191a7fbb138fb95718d Mon Sep 17 00:00:00 2001 From: Sinspired <63581268+sinspired@users.noreply.github.com> Date: Sat, 7 Dec 2024 09:38:54 +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 | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/.github/workflows/update_hosts.yml b/.github/workflows/update_hosts.yml index e9f867c..3c3fa70 100644 --- a/.github/workflows/update_hosts.yml +++ b/.github/workflows/update_hosts.yml @@ -16,15 +16,28 @@ permissions: contents: write jobs: - lint: + autoyapf: runs-on: ubuntu-latest - strategy: - matrix: - linter: [flake8, pylint, ruff, mypy, pytype, pyright, fixit, pyre] steps: - - uses: advanced-security/python-lint-code-scanning-action@v1 + - uses: actions/checkout@master with: - linter: ${{ matrix.linter }} + ref: ${{ github.head_ref }} + - name: autoyapf + id: autoyapf + uses: mritunjaysharma394/autoyapf@v2 + with: + args: --style pep8 --recursive --in-place . + - name: Check for modified files + id: git-check + run: echo ::set-output name=modified::$(if git diff-index --quiet HEAD --; then echo "false"; else echo "true"; fi) + - name: Push changes + if: steps.git-check.outputs.modified == 'true' + run: | + git config --global user.name 'github-actions' + git config --global user.email 'github-actions@github.com' + git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }} + git commit -am "Automated autoyapf fixes" + git push update-hosts: runs-on: ubuntu-latest