-
-
Notifications
You must be signed in to change notification settings - Fork 4
38 lines (35 loc) · 1.31 KB
/
autopep8-command.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
name: autopep8-command
on:
repository_dispatch:
types: [autopep8-command]
jobs:
autopep8:
runs-on: ubuntu-latest
steps:
# Checkout the pull request branch
- uses: actions/checkout@v4
with:
token: ${{ secrets.ACTIONS_BOT_TOKEN }}
repository: ${{ github.event.client_payload.pull_request.head.repo.full_name }}
ref: ${{ github.event.client_payload.pull_request.head.ref }}
# Run autopep8
- name: autopep8
id: autopep8
uses: peter-evans/autopep8@v2
with:
args: --exit-code --recursive --in-place --aggressive --aggressive .
# Commit the change to the PR branch
- name: Commit to the PR branch
if: steps.autopep8.outputs.exit-code == 2
run: |
git config --global user.name 'actions-bot'
git config --global user.email '[email protected]'
git commit -am "[autopep8-command] fixes"
git push
- name: Add reaction
uses: peter-evans/create-or-update-comment@v4
with:
token: ${{ secrets.ACTIONS_BOT_TOKEN }}
repository: ${{ github.event.client_payload.github.payload.repository.full_name }}
comment-id: ${{ github.event.client_payload.github.payload.comment.id }}
reactions: hooray