fix(github): emit repo under canonical repo key so automations match#402
Merged
viktormarinho merged 1 commit intomainfrom Apr 23, 2026
Merged
Conversation
…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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
🤖 Generated with Claude Code
Summary by cubic
Fixes GitHub webhook events so the repo is emitted under the canonical
repokey, allowing automations that filter byrepoto match. Keepsrepositoryas an alias for backward compatibility.Written for commit 717388f. Summary will update on new commits.