autopep8-command.yml 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. name: autopep8-command
  2. on:
  3. repository_dispatch:
  4. types: [autopep8-command]
  5. jobs:
  6. autopep8:
  7. runs-on: ubuntu-latest
  8. steps:
  9. # Checkout the pull request branch
  10. - uses: actions/checkout@v2
  11. with:
  12. token: ${{ secrets.GITHUB_TOKEN }}
  13. repository: ${{ github.event.client_payload.pull_request.head.repo.full_name }}
  14. ref: ${{ github.event.client_payload.pull_request.head.ref }}
  15. # Run autopep8
  16. - name: autopep8
  17. id: autopep8
  18. uses: peter-evans/autopep8@v1
  19. with:
  20. args: --exit-code --jobs 0 --recursive --in-place --aggressive --aggressive .
  21. # Commit the change to the PR branch
  22. - name: Commit to the PR branch
  23. if: steps.autopep8.outputs.exit-code == 2
  24. run: |
  25. git config --global user.name 'actions-bot'
  26. git config --global user.email '58130806+actions-bot@users.noreply.github.com'
  27. git commit -am "[autopep8-command] fixes" -s
  28. git push
  29. - name: Add reaction
  30. uses: peter-evans/create-or-update-comment@v1
  31. with:
  32. token: ${{ secrets.GITHUB_TOKEN }}
  33. repository: ${{ github.event.client_payload.github.payload.repository.full_name }}
  34. comment-id: ${{ github.event.client_payload.github.payload.comment.id }}
  35. reaction-type: hooray