22 Jul 2023 - rich
How do you use webhooks? How do you create them? How do you troubleshoot them? Fortunately they are very straightforward to setup and use. Still, there may be a few questions that need to be answered.
Webhooks proide a way for notifications to be delivered to an external web server whenever certain events occur on GitHub.
Webhooks can be triggered whenever specific events occur on GitHub (push, pull-request, new member added to team, etc…)
Most of my rants about searching for answers on the web are about people who take an existing piece of documentation, publish another article, pretty much about the same thing, and don’t add much if any additional value or embellishment to the original.
I am not above this myself but would like to think that I am pretty much aware of it when I do and and have a pretty good explanation for adding to all the existing chaff.
When initially setting up webhooks in Github for use with Jenkins, I had a few basic questions that were not really answered…
When you add a webhook, you choose which events you would like to subscribe to. By default, webhooks installed on an organization or a repository level are only subscribed to push events. And, webhooks for GitHub Apps are not subscribed to any events. Check out “webhook events and payloads” for a complete list of webhook events.
You can review your webhook deliveries from Github. This includes the HTTP request and the payload as well as the response. Gihub webhooks view provides tooling for testing out your deployed payloads.
For each webhook you create, there exists a “recent deliveries” section within the webhooks information section. You can see, visually, if a delivery was successful or not. Additionally, you can see when the deliveries were attempted. This log persists for 30 days.
references: Cloudbees webhook troubleshooting Testing Webhooks About Webhooks “webhook events and payloads”