-
Notifications
You must be signed in to change notification settings - Fork 90
50 lines (44 loc) · 1.51 KB
/
Copy pathTrigger PR Automation.yml
File metadata and controls
50 lines (44 loc) · 1.51 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
48
49
50
name: Trigger Auto Merge Automation
on:
pull_request_target:
types:
- opened
- reopened
- synchronize
- ready_for_review
workflow_run:
workflows:
- Core CI
types:
- completed
permissions:
contents: read
jobs:
trigger-auto-merge:
name: Trigger central PR automation
runs-on: ubuntu-latest
steps:
- name: Trigger automation repo from PR event
if: github.event_name == 'pull_request_target'
env:
GH_TOKEN: ${{ secrets.AUTO_MERGE_TOKEN }}
run: |
gh api \
--method POST \
-H "Accept: application/vnd.github+json" \
/repos/Adamantine-guild/adamantine-pr-automation/dispatches \
-f event_type=guildpass-pr-opened \
-F client_payload[repo]="${{ github.repository }}" \
-F client_payload[pr_number]="${{ github.event.pull_request.number }}"
- name: Trigger automation repo after Core CI
if: github.event_name == 'workflow_run' && github.event.workflow_run.event == 'pull_request'
env:
GH_TOKEN: ${{ secrets.AUTO_MERGE_TOKEN }}
run: |
gh api \
--method POST \
-H "Accept: application/vnd.github+json" \
/repos/Adamantine-guild/adamantine-pr-automation/dispatches \
-f event_type=guildpass-pr-opened \
-F client_payload[repo]="${{ github.repository }}" \
-F client_payload[pr_number]="${{ github.event.workflow_run.pull_requests[0].number }}"