ci/cla-bot-worker/README.md
Cloudflare Worker that receives GitHub webhook events and enforces the TensorZero Contributor License Agreement on pull requests across every repo in the tensorzero org.
This Worker is deployed manually. Changes here are not automatically deployed.
pull_request (opened, reopened, synchronize): collects every distinct GitHub user who authored or committed any commit in the PR (plus the PR opener), drops [bot] accounts and allowlisted users, and compares the rest against ci/cla-signatures.json on the target repo's cla-signatures branch.issue_comment (created) on a PR:
recheck → re-evaluate.cla on the PR head SHA. Conclusion is success (everyone signed) or action_required (someone hasn't).The bot acts on whichever repo a webhook arrives from, as long as the repo's owner matches GITHUB_ORG. To extend coverage, just install the GitHub App on more repos (or set the install scope to "All repositories"); no worker change is needed.
Each repo gets its own cla-signatures branch + ci/cla-signatures.json. The bot lazily creates the branch as an orphan commit on first need (no main-branch history pollution).
npx wrangler deploy
Set via wrangler secret put <NAME>:
GITHUB_APP_ID: GitHub App ID (from app settings page).GITHUB_APP_PRIVATE_KEY: GitHub App private key (must be PKCS#8 format; convert with openssl pkcs8 -topk8 -inform PEM -outform PEM -nocrypt -in key.pem -out key-pkcs8.pem).GITHUB_INSTALLATION_ID: installation ID (run gh api /orgs/tensorzero/installations --jq '.installations[] | "\(.app_slug) \(.id)"').GITHUB_WEBHOOK_SECRET: webhook secret configured in the GitHub App.TensorZero CLA Bothttps://tensorzero-cla-bot.tensorzero.workers.dev)GITHUB_WEBHOOK_SECRETcla-signatures branch; create the branch on first use)issues.createComment)cla Check Run)merge_group)tensorzero organization with scope All repositories (covers current + future repos automatically).If you change permissions on an existing app, the org owner must re-accept them on the installation page before they take effect. The installation ID does not change; no secret update needed.
For each repo where you want the CLA check to actually block merge, add the Check Run cla from TensorZero CLA Bot as a required status check on the protected branch (e.g. main). Repos without this rule still see the bot's check + comment, but merge isn't gated.