v1.4.1: read X-*-Event-Type header (fixes dropped package/action_run events) #4
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix-event-type-header"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Forgejo and Gitea set two event headers with different values
(services/webhook/shared/payloader.go: AddDefaultHeaders):
X--Event = HookEventType.Event() -> a derived value, written
identically to the Gitea/Forgejo/Gogs/GitHub -Event
headers; observed EMPTY for some events (e.g. package)
X--Event-Type = string(HookEventType) -> raw type, matches FORMATTERS keys
We only read X--Event, so package and action_run deliveries arrived with
an empty event header and were rejected with HTTP 400 "Missing event
header", dropping the notification. Read X--Event-Type first, fall back
to X--Event. conftest signed_headers now emits both headers like the
real forges; add a regression test for the empty-X--Event case.
Also fix the package formatter showing "[unknown]" for user-scoped
packages (top-level repository and organization both null) by falling
back to package.repository then package.owner.
100 tests pass.
Co-Authored-By: Claude Opus 4.8 noreply@anthropic.com
Forgejo and Gitea set two event headers with different values (services/webhook/shared/payloader.go: AddDefaultHeaders): X-*-Event = HookEventType.Event() -> a derived value, written identically to the Gitea/Forgejo/Gogs/GitHub -Event headers; observed EMPTY for some events (e.g. package) X-*-Event-Type = string(HookEventType) -> raw type, matches FORMATTERS keys We only read X-*-Event, so package and action_run deliveries arrived with an empty event header and were rejected with HTTP 400 "Missing event header", dropping the notification. Read X-*-Event-Type first, fall back to X-*-Event. conftest signed_headers now emits both headers like the real forges; add a regression test for the empty-X-*-Event case. Also fix the package formatter showing "[unknown]" for user-scoped packages (top-level repository and organization both null) by falling back to package.repository then package.owner. 100 tests pass. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>