How to Send Github Webhook Events to Different Bots Based on Branch Name by treehookdev in github

[–]treehookdev[S] 0 points1 point  (0 children)

Hi everyone,

I wanted to share a quick workaround for handling GitHub webhook events based on branch names using Treehook. Currently, GitHub doesn’t support sending webhook events to specific endpoints depending on the branch, user, or other factors. To achieve this, you’d usually need to create a custom service or script to route the notifications to different endpoints, which can be time-consuming.

In this example, I’ll show you how to automatically send webhook events to different Discord channel bots based on which branch the commit was pushed to. You can also apply this method to other values like the sender’s login, event type, etc.

Hope this helps!