forked from peter-evans/create-pull-request-tests
-
Notifications
You must be signed in to change notification settings - Fork 0
47 lines (42 loc) · 1.6 KB
/
clean-command.yml
File metadata and controls
47 lines (42 loc) · 1.6 KB
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
39
40
41
42
43
44
45
46
47
name: clean-command
on:
repository_dispatch:
types: [clean-command]
jobs:
clean:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
# Clean up pull requests and branches
- name: Close Pull Requests
uses: ./.github/close-pull-requests
- name: Close Pull Requests
uses: ./.github/close-pull-requests
with:
token: ${{ secrets.REPO_ACCESS_TOKEN }}
repository: peter-evans/create-pull-request-tests-remote
- name: Close Pull Requests
uses: ./.github/close-pull-requests
with:
token: ${{ secrets.REPO_ACCESS_TOKEN }}
repository: peter-evans/create-pull-request-tests-remote-private
# Delete the test branch created in the fork
- uses: actions/checkout@v2
with:
token: ${{ secrets.CPR_MACHINE_USER_TOKEN }}
repository: create-pull-request-machine-user/create-pull-request-tests
ref: master
path: create-pull-request-machine-user-fork
- name: Delete fork branches
working-directory: create-pull-request-machine-user-fork
run: |
git fetch
git push --force --delete origin refs/heads/tests/push-branch-to-fork || true
# Add reaction to the comment
- name: Add reaction
uses: peter-evans/create-or-update-comment@v1
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 }}
reaction-type: hooray