Skip to content

Commit

Permalink
major fix
Browse files Browse the repository at this point in the history
  • Loading branch information
technocreep committed May 17, 2024
1 parent b7956fe commit d737a62
Showing 1 changed file with 11 additions and 21 deletions.
32 changes: 11 additions & 21 deletions .github/workflows/pep8_action.yml
Original file line number Diff line number Diff line change
@@ -1,34 +1,24 @@
name: fix-pep8-command
on:
pull_request:
branches:
- main
name: autopep8
on: pull_request
jobs:
fix-pep8:
autopep8:
# Check if the PR is not from a fork
if: github.event.pull_request.head.repo.full_name == github.repository
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v2
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: Switch to pull request branch
run: |
git checkout ${{ github.event.client_payload.pull_request.head.ref }}
ref: ${{ github.head_ref }}
- name: autopep8
id: autopep8
uses: peter-evans/autopep8@v2
with:
args: --exit-code --max-line-length 120 --recursive --in-place --aggressive --aggressive .
args: --exit-code --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 add .
git config --global user.name 'autopep8 bot'
git config --global user.email 'autopep8bot@users.noreply.github.com'
git commit -am "Automated autopep8 fixes"
git push
git push

0 comments on commit d737a62

Please sign in to comment.