Webhooks
Last updated
Last updated
Trunk provides a variety of webhooks to allow responding to various events from Trunk. Each event corresponds to a Trunk product and an action within that product (for example, a Pull Request being submitted to Trunk Merge).
Trunk provides various webhooks to respond to events from Trunk Flaky Tests. Flaky Test events are named with a pull_request
prefix, you can find the events you can respond to in the Webhook Events reference from Svix.
You can learn about the Svix event catalog in the Svix docs.
If you don't currently have an endpoint ready to receive webhooks, you can quickly set up a URL for testing by clicking the "use Svix Play" link - you'll be able to inspect all webhook events sent there.
You can configure webhooks, view the supported events, and see past webhook requests in the Trunk Web App under Settings > Organization > Webhooks.
From the "Logs" and "Activity" tabs, it's possible to view all emitted webhooks and their payloads and search them, examine the responses returned to us after processing a webhook and which ones failed, and resend webhook events. This allows you to have full insight into how your system is handling webhooks from Trunk.
If you're building custom apps to receive webhooks sent from Trunk, you should verify Webhooks to prevent malicious attacks from impersonation.
Svix provides a library in order to allow easy verification of these webhook signatures. Docs on how to set this up can be found here. If you wish to verify webhooks manually instead, you can find Svix docs on how to do that here.
To integrate with a third-party service such as Slack or GitHub Issues, you need to configure webhooks to send requests to their APIs. In the Endpoints tab, you can configure sending webhooks to a predetermined endpoint by clicking the Add Endpoint button. You can find docs about adding endpoints from the Svix docs.