Many times, I want to know what the Json payload looks like when an event occurs on GitHub that triggers a GitHub Actions workflow.
In the past, I used to setup a Webhook that sends the json payload to my local server. Now, I use GitHub Actions to print the whole json payload.
The delete event sends a delete webhook payload.
To print out the payload, I use the workflow below:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
name: Dump GH events and payloads
on:
delete
jobs:
test:
name: debug
runs-on: [ubuntu]
steps:
- name: print whole context
env:
GITHUB_CONTEXT: $
run: |
echo "$GITHUB_CONTEXT"
- name: print delete webhook payload
run: |
echo $