A generic, secure Cloudflare Worker proxy to trigger GitHub Repository Dispatch events for automated workflows across multiple repositories.
- Generic: Trigger actions on any repository you have access to.
- Secure: Proxy authentication via custom
X-Proxy-Authheader. - Serverless: Built on Cloudflare Workers for lightning-fast execution.
- Standardized: Fully compatible with GitHub's
repository_dispatchAPI.
Send a POST request to your worker URL:
POST https://your-worker-url.workers.dev/:owner/:repo
X-Proxy-Auth: <YOUR_PROXY_API_KEY>
Content-Type: application/json
{
"event_type": "deploy-workflow",
"client_payload": {
"environment": "production",
"version": "1.0.0"
}
}To react to this dispatch event, add a workflow file (e.g., .github/workflows/dispatch.yml) in the target repository:
name: Handle Dispatch
on:
repository_dispatch:
types: [deploy-workflow]
jobs:
run-task:
runs-on: ubuntu-latest
steps:
- name: Log payload
run: |
echo "Environment: ${{ github.event.client_payload.environment }}"
echo "Version: ${{ github.event.client_payload.version }}"The worker uses the following environment variables (set via wrangler secret):
PROXY_API_KEY: A secret key you define to secure access to the proxy.GITHUB_TOKEN: A fine-grained GitHub token withContents: Read & Writepermissions.
The project includes an automation script to simplify deployment:
- Create a
.envfile based on.env.example. - Make the script executable:
chmod +x deploy.sh
- Run the deployment:
./deploy.sh