Repository navigation
fix: accept null in WebhookPayload IssueRef and Repository string fields - #135
Conversation
Signed-off-by: C. Spencer Beggs <spencer@savvyweb.systems>
GitHub webhook payloads carry body, html_url, and full_name as null when the issue or PR has no description. The schema previously only allowed string or undefined, so ActionEnvironment.payload failed on real pull_request events. Switch the affected optional fields to optional NullOr String. Signed-off-by: C. Spencer Beggs <spencer@beggs.codes>
Code ReviewCurrent Commit: SummaryClean, targeted fix. The schema change is correct, the tests directly reproduce the bug, and all five validation checks pass. What ChangedThe PR switches four
This correctly models all three states GitHub can send: absent (undefined), present-but-null, and a string value. The previous schema had no way to represent the null case, causing decode failures on real Validation
ObservationsSchema fix: Correct approach. Tests: Both new test cases are well-structured — they pass null explicitly and assert
Ancillary changes: The Patch changeset: Correct bump level — this is a backwards-compatible bug fix. Consumers previously failing on null payloads will now succeed; no existing consumers are broken. No actionable issues. Approving. |
Summary
ActionEnvironment.payloadfailed to decode realpull_requestevents because theWebhookPayloadschema declaredIssueRef.body,IssueRef.html_url,Repository.full_name, andRepository.html_urlasSchema.optional(Schema.String)— string-or-undefined. GitHub webhook payloads carry these fields asnull(not absent) when the issue or PR has no description, or when the event payload omits the rendered URL.Switch the four affected optional fields to
Schema.optional(Schema.NullOr(Schema.String)).Repro
Job that exposed it: https://github.com/savvy-web/rslib-builder/actions/runs/26596426144/job/78380850728
Calling
savvy-web/silk-router-action@v1(which uses@savvy-web/github-action-effects^2.0.0) on a pull_request event withpull_request.body = nulltriggered:Test plan
src/schemas/EventPayload.test.tscover both thepull_requestandrepositorypaths.pnpm test— 1244 tests pass.pnpm typecheckpasses.pnpm lintclean.pnpm ci:buildsucceeds.Changeset
patchin.changeset/webhook-payload-null-fields.md.Signed-off-by: C. Spencer Beggs spencer@savvyweb.systems