forked from sidd-harth/ga-2
-
Notifications
You must be signed in to change notification settings - Fork 0
57 lines (55 loc) · 2.42 KB
/
dispatch.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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
name: Repository Dispatch
on:
repository_dispatch:
types: [my-check]
jobs:
myEvent:
runs-on: ubuntu-latest
steps:
####################################################
# Update the status to show that the queued message
# was received and is being processed
####################################################
- name: Acknowledge Request
env:
GH_TOKEN: ${{ github.token }}
run: |
gh api -X PATCH -H "Accept: application/vnd.github+json" \
-H "X-GitHub-Api-Version: 2022-11-28" \
-f 'status=in_progress' \
-f 'output[title]=My Check Run Title 🤔' \
-f 'output[summary]=A *fancy* summary' \
-f 'output[images][][image_url]=https://www.kenmuse.com/favicon/apple-touch-icon.png' \
-f 'output[images][][caption]=Sample from kenmuse.com' \
-f 'output[images][][alt]=Logo for kenmuse.com' \
/repos/${{ github.repository }}/check-runs/${{ github.event.client_payload.checkRunId }}
####################################################
# Actually, we'll just sleep to simulate some work
####################################################
- name: Processing
run: sleep 120
#####################################################
# Send a final message to complete the run and
# provide any final updates. Doing this one in JSON
# to make it more readable. This approach can also
# be used to get total control over the serialized
# data types (for example, integers).
#####################################################
- name: Complete Check
env:
GH_TOKEN: ${{ github.token }}
run: |
gh api -X PATCH -H "Accept: application/vnd.github+json" \
-H "X-GitHub-Api-Version: 2022-11-28" \
/repos/${{ github.repository }}/check-runs/${{ github.event.client_payload.checkRunId }} \
--input - <<- EOF
{
"conclusion": "success",
"details_url": "https://details.kenmuse.com",
"output": {
"title": "My Check Run Title 🚀",
"summary": "**Summary**: The run completed.",
"text": "Everything worked as expected. You should see a logo above."
}
}
EOF