Skip to content

Autopep8 action

Autopep8 action #8

Workflow file for this run

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 --recursive ./fedot_ind ./tests
- uses: actions/github-script@v6
with:
github-token: ${{ secrets.PEP8_TOKEN }}
script: |
git diff --quiet ./fedot_ind ./tests # Only check for changes in relevant files
if [ $? -eq 0 ]; then
echo "No PEP 8 style changes detected."
exit 0
fi
git add .
git commit -m "Fix PEP 8 style violations"
target_branch=${{ github.event.pull_request.head.ref }}
git push origin $target_branch