diff options
Diffstat (limited to 'CLAUDE.md')
| -rw-r--r-- | CLAUDE.md | 47 |
1 files changed, 47 insertions, 0 deletions
@@ -119,6 +119,53 @@ After each task execution, Claudomator extracts git diff statistics from the exe **Frontend display:** `web/app.js` renders a `.changestats-badge` on COMPLETED/READY task cards and in execution history rows. +## GitHub Webhook Integration + +Claudomator can automatically create tasks when CI builds fail on GitHub. + +### Endpoint + +`POST /api/webhooks/github` + +Accepts `check_run` and `workflow_run` events from GitHub. Returns `{"task_id": "..."}` (200) when a task is created, or 204 when the event is ignored. + +### Config (`~/.claudomator/config.toml`) + +```toml +# Optional: HMAC-SHA256 secret set in the GitHub webhook settings. +# If omitted, signature validation is skipped. +webhook_secret = "your-github-webhook-secret" + +# Projects for matching incoming webhook repository names to local directories. +[[projects]] +name = "myrepo" +dir = "/workspace/myrepo" + +[[projects]] +name = "other-service" +dir = "/workspace/other-service" +``` + +### Matching logic + +The handler matches the webhook's `repository.name` against each project's `name` and the basename of its `dir` (case-insensitive substring). If no match is found and only one project is configured, that project is used as a fallback. + +### GitHub webhook setup + +In your GitHub repository → Settings → Webhooks → Add webhook: +- **Payload URL:** `https://<your-claudomator-host>/api/webhooks/github` +- **Content type:** `application/json` +- **Secret:** value of `webhook_secret` in config (or leave blank if not configured) +- **Events:** select *Workflow runs* and *Check runs* + +### Task creation + +A task is created for: +- `check_run` events with `action: completed` and `conclusion: failure` +- `workflow_run` events with `action: completed` and `conclusion: failure` or `timed_out` + +Tasks are tagged `["ci", "auto"]`, capped at $3 USD, and use tools: Read, Edit, Bash, Glob, Grep. + ## ADRs See `docs/adr/001-language-and-architecture.md` for the Go + SQLite + WebSocket rationale. |
