Filter the GitHub webhook events on your repositories with arbitrary JSONata expressions.
- Copy
wrangler.example.jsonctowrangler.jsoncand fill in your allowed repo list, separated by commas. - Deploy to Cloudflare Workers with
pnpm deploy. - Edit your GitHub webhook configuration to set the URL to
https://<your-worker-subdomain>.workers.dev/?expression=<jsonata-expression>&url=<target-url>, where:<jsonata-expression>is a JSONata expression that will be evaluated against the{ headers, body }object, whereheadersis the flatten header entries (array of[key, value]tuples) andbodyis the parsed JSON body of the webhook event.<target-url>is the URL of the service you want to forward the webhook event to when the former evaluates to a truthy value.
To diagnose the evaluation of your expression, you can use the ?debug query parameter to echo back the evaluation result instead of forwarding the request to the target URL.