Adding autopep8 Action #1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: autopep8 | |
on: | |
push: | |
branches: [main] | |
pull_request: | |
branches: [main] | |
jobs: | |
autopep8: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: autopep8 | |
id: autopep8 | |
uses: peter-evans/autopep8@v2 | |
with: | |
args: --recursive --in-place --aggressive . | |
- name: Commit autopep8 changes | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
if: steps.autopep8.outputs.exit-code == 2 | |
run: | | |
git config --global user.name 'GitHub Actions' | |
git config --global user.email '[email protected]' | |
git add . | |
git commit -m "autopep8: $(date +'%Y-%m-%d')" | |
git push |