Skip to content

Commit

Permalink
updated pep8 action
Browse files Browse the repository at this point in the history
  • Loading branch information
technocreep committed May 16, 2024
1 parent 0fb49ce commit 118506f
Showing 1 changed file with 22 additions and 28 deletions.
50 changes: 22 additions & 28 deletions .github/workflows/pep8_action.yml
Original file line number Diff line number Diff line change
@@ -1,32 +1,26 @@
name: Fix PEP 8 Style

name: fix-pep8-command
on:
pull_request:
branches: [ main ]

repository_dispatch:
types: [fix-pep8-command]
jobs:
fix_pep8:
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

- name: Checkout PR
env:
GITHUB_TOKEN: ${{ secrets.PEP8_TOKEN }}
run: gh pr checkout ${{ github.event.pull_request.number }}

- name: Push changes
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
run:
git add .
git commit -m "Fix PEP 8 style violations"
git push origin ${{ github.event.pull_request.head.ref }}
- uses: actions/checkout@v4
with:
token: ${{ secrets.PEP8_TOKEN }}
repository: ${{ github.event.client_payload.pull_request.head.repo.full_name }}
ref: ${{ github.event.client_payload.pull_request.head.ref }}
- name: autopep8
id: autopep8
uses: peter-evans/autopep8@v2
with:
args: --exit-code --max-line-length 120 --recursive --in-place --aggressive --aggressive .
- name: Commit autopep8 changes
id: cap8c
if: steps.autopep8.outputs.exit-code == 2
run: |
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
git commit -am "Automated autopep8 fixes"
git push

0 comments on commit 118506f

Please sign in to comment.