GitHub.com. When one of those events is triggered, GitHub sends an HTTP POST payload to the webhook’s configured URL. Webhooks can be used to update an external issue tracker, trigger CI builds, update a backup mirror, or even deploy to your production server.
This guide will walk through the steps to set up RisingWave as a destination for GitHub webhooks.
New to RisingWave webhooks? Before configuring GitHub, it’s recommended to run a quick local smoke test to confirm your RisingWave webhook listener is reachable and your table is ingesting events. See Webhook endpoint and Quick local smoke test.
1. Create a table in RisingWave
Next, create a table configured to accept webhook data from GitHub.
In GitHub webhook, you can choose between
SHA-1 and SHA-256 HMAC algorithms for signing the payload. The example above uses SHA-256 HMAC. If you want to use SHA-1, change x-hub-signature-256 into x-hub-signature, sha256 into sha1 in the VALIDATE clause.
Or you can also use raw string for verification without secret:
2. Set up webhook in GitHub
After configuring RisingWave to accept webhook data, set up GitHub to send events to your RisingWave instance.RisingWave webhook URL
The webhook URL should follow this format:https://<HOST>/webhook/<database>/<schema_name>/<table_name>.
Configure webhook in GitHub
For more detailed instructions, refer to the GitHub documentation.1
Go to your GitHub repository, and click on Settings tab.
2
In the left sidebar, click on webhooks > Add webhook.
3
Configure the webhook settings:
- Payload URL: Enter your RisingWave webhook URL.
- Content type: Select
application/json. - Secret: Enter the same secret string you used when creating the RisingWave secret (e.g.,
'TEST_WEBHOOK'). This ensures that GitHub signs the payloads using this secret, allowing RisingWave to validate them. - Which events would you like to trigger this webhook?: Choose the events you want to subscribe to. For testing purposes, you might start with Just the push event.
- Active: Ensure the webhook is set to active.
4
Click Add webhook at the bottom of the page to save.
3. Push data from GitHub via webhook
With the webhook configured, GitHub will automatically send HTTP POST requests to your RisingWave webhook URL whenever the specified events occur (e.g., pushes to the repository). RisingWave will receive these requests, validate the signatures, and insert the payload data into the target table.4. Further event processing
The data in the table is already ready for further processing. You can access the fields usingdata->'field_name' in SQL queries.
You can create a materialized view to extract specific fields from the JSON payload.
github_events like a regular table to perform analytics, generate reports, or trigger further processing.