diff --git a/.github/workflows/black.yml b/.github/workflows/black.yml deleted file mode 100644 index c2964fb9..00000000 --- a/.github/workflows/black.yml +++ /dev/null @@ -1,10 +0,0 @@ -name: Lint - -on: [pull_request] - -jobs: - lint: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: psf/black@stable diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 00000000..128a0302 --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,24 @@ +name: autopep8 +on: pull_request +jobs: + autopep8: + # Check if the PR is not from a fork + if: github.event.pull_request.head.repo.full_name == github.repository + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: + token: ${{ secrets.REPO_ACCESS_TOKEN }} + ref: ${{ github.head_ref }} + - name: autopep8 + id: autopep8 + uses: peter-evans/autopep8@v2 + with: + args: --exit-code --recursive --in-place --aggressive --aggressive . + - name: Commit autopep8 changes + if: steps.autopep8.outputs.exit-code == 2 + run: | + git config --global user.name 'Peter Evans' + git config --global user.email 'peter-evans@users.noreply.github.com' + git commit -am "Automated autopep8 fixes" + git push