Webhook Example: Github
Webhook Example: Github
Webhook Example: Github
GitHub webhooks notify your endpoint of repository events like pushes or pull requests. They use optional signature verification for security, with no initial challenge. This pattern is common for services prioritizing payload integrity over setup ceremonies.
Registration establishes the shared secret and URL. In GitHub:
Navigate to your repository > Settings > Webhooks > Add webhook.
Payload URL: Your Agent Studio listener URL (e.g., https://your-instance.moveworks.ai/webhooks/v1/listeners/your-listener/notify). This is where GitHub sends POST requests.
Content type: application/json.
Generate and enter a strong Secret,this becomes the key for HMAC signing, shared only between GitHub and your listener.
Select individual events (e.g., Push events) to control what triggers notifications.
Add webhook.
Upon saving, GitHub sends a “ping” event (identified by header x-github-event: ping). This tests connectivity but doesn’t require special handling, treat it as a valid event.
Signature verification ensures authenticity. GitHub signs the raw body with HMAC-SHA256, sending the result in a header. In Agent Studio’s Verification panel:
Signature Verification (HMAC).HMAC-SHA256, matching GitHub’s algorithmraw_body. GitHub signs the unparsed bytes, so this preserves exact contentheaders["x-hub-signature-256"]. This header includes a sha256= prefix, which Agent Studio infers and strips during comparisonThese fields interconnect: The payload feeds into HMAC with the secret and mode, producing an expected signature matched against the received one