Skip to main content
This recipe helps you validate the Shield CI/CD webhook receiver end-to-end. It is based on the implementation in domain/shield/apps/cicd/webhooks.py.

Prerequisites

  • Shield running locally.
  • GITHUB_WEBHOOK_SECRET configured for the Shield service (this is what the code reads).

1) Confirm the health endpoint

By default, the GitHub Actions webhook routes are mounted under:
  • GET /api/v1/webhooks/github-actions/health
If this does not return 200/healthy, check Shield routing and logs.

2) Send a signed workflow_run payload

Create a minimal payload (this is a small subset of what GitHub sends):
Now sign and send it. This reuses the standard GitHub-style signature header. This sends a JSON payload with a GitHub-style HMAC signature header.
To reuse this snippet, set:
  • WEBHOOK_BASE_URL
  • GITHUB_WEBHOOK_SECRET
  • payload (and optionally X-GitHub-Delivery)
Important: for GitHub Actions payloads, set these headers:
  • X-GitHub-Event: workflow_run
  • X-GitHub-Delivery: <unique id>
Update the snippet’s endpoint to:
  • POST /api/v1/webhooks/github-actions/

Expected results

  • HTTP 202 with a JSON body indicating the event was queued.
  • Shield logs should show receipt of the delivery id and event type.

Troubleshooting

  • 401 Invalid signature: verify GITHUB_WEBHOOK_SECRET matches what you used to sign.
  • 400 Invalid JSON payload: ensure the request body is valid JSON and sent with Content-Type: application/json.