Skip to content

fix(github): emit repo under canonical repo key so automations match#402

Merged
viktormarinho merged 1 commit intomainfrom
viktormarinho/github-webhook-repo-param
Apr 23, 2026
Merged

fix(github): emit repo under canonical repo key so automations match#402
viktormarinho merged 1 commit intomainfrom
viktormarinho/github-webhook-repo-param

Conversation

@viktormarinho
Copy link
Copy Markdown
Contributor

@viktormarinho viktormarinho commented Apr 23, 2026

Context

Full webhook path worked end-to-end — verified in production logs:

```
[Webhook] ← delivery=b9903d64… event=issues hook=609463396
[Webhook] → delivery=b9903d64… event=github.issues.opened subject=decocms/studio installation=120173638 connection=conn_LY5860COJlW4bIZqLufd5 sender=viktormarinho action=opened
[Webhook] ✓ delivery=b9903d64… mesh callback delivered (202)
```

Mesh accepted with 202 but the matching automation never fired. Confirmed the Studio-side trigger was configured correctly:

```
automation.active = true
trigger.event_type = 'github.issues.opened'
trigger.connection_id = 'conn_LY5860COJlW4bIZqLufd5'
trigger.params = {"repo": "decocms/studio"}
```

Root cause

`EventTriggerEngine.paramsMatch` in Studio does strict key equality:

```ts
return Object.entries(params).every(([key, value]) => data[key] === value);
```

So it looked up `data.repo` — but our webhook handler was shipping the repo under `data.repository`, leaving `data.repo === undefined` and the match failed silently.

Fix

Emit the repo full name under the canonical `repo` key (what the trigger params schema in `trigger-store.ts` declares). Kept `repository` as an alias for downstream consumers that might already depend on it.

Test plan

  • After deploy, create an issue in `decocms/studio`. Expect `[Webhook] ✓ delivery=… mesh callback delivered (202)` in worker logs as before, AND a new `threads` row in Studio's DB with `status = in_progress → completed`.

🤖 Generated with Claude Code


Summary by cubic

Fixes GitHub webhook events so the repo is emitted under the canonical repo key, allowing automations that filter by repo to match. Keeps repository as an alias for backward compatibility.

Written for commit 717388f. Summary will update on new commits.

…match

Mesh's EventTriggerEngine.paramsMatch compares trigger params to the
event data with strict `data[key] === value`. The trigger-store.ts
schema names the param `repo`, but the webhook handler was shipping
the repository full name as `data.repository`, so every trigger with
a `{ "repo": "owner/name" }` filter silently failed to match and no
thread was ever fired.

Also keeps `repository` as an alias so anything reading that key
keeps working.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@viktormarinho viktormarinho merged commit 6e26d88 into main Apr 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant