Skip to content

Commit

Permalink
Update autopep8.yml
Browse files Browse the repository at this point in the history
This step checks for changes that need to be committed to avoid CI failure.
> If there are no changes (the working tree is clean), this step will output 'No changes to commit.' and exit early to prevent the workflow from failing.
  • Loading branch information
MacixOwl authored Dec 29, 2024
1 parent 875a4f9 commit cd77c46
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion .github/workflows/autopep8.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,18 @@ jobs:
run: |
autopep8 --in-place --aggressive --recursive .
# Check if any files have changed after running autopep8
- name: Check for changes
id: check_changes
run: |
git diff --exit-code || echo "Changes detected"
- name: Commit and push changes
if: steps.check_changes.outputs.changed == 'true'
run: |
git config --global user.name "autopep8-bot"
git config --global user.email "[email protected]"
git add .
git commit -m "Fix PEP 8 issues [no ci]"
git push
if: ${{ success() }}

0 comments on commit cd77c46

Please sign in to comment.