added pep8 action #1
Workflow file for this run
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: Fix PEP 8 Style | |
on: | |
pull_request: | |
branches: [ main ] | |
jobs: | |
fix_pep8: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install autopep8 | |
run: pip install --upgrade autopep8 | |
- name: Fix PEP 8 style violations | |
run: autopep8 --in-place --aggressive . | |
- uses: actions/github-script@v6 | |
with: | |
github-token: ${{ secrets.PEP8_TOKEN }} | |
if git diff --quiet; then | |
echo "No PEP 8 style changes detected." | |
exit 0 | |
fi | |
git add . | |
git commit -m "Fix PEP 8 style violations" | |
git push origin HEAD:main |