diff --git a/src/middleware/node/middleware.ts b/src/middleware/node/middleware.ts index 74991dcf..405bce52 100644 --- a/src/middleware/node/middleware.ts +++ b/src/middleware/node/middleware.ts @@ -2,8 +2,6 @@ // see https://github.com/octokit/octokit.js/issues/2075#issuecomment-817361886 import type { IncomingMessage, ServerResponse } from "node:http"; -import type { WebhookEventName } from "../../generated/webhook-identifiers.js"; - import type { Webhooks } from "../../index.js"; import type { WebhookEventHandlerError } from "../../types.js"; import type { MiddlewareOptions } from "./types.js"; @@ -75,7 +73,7 @@ export async function middleware( return true; } - const eventName = request.headers["x-github-event"] as WebhookEventName; + const eventName = request.headers["x-github-event"] as string; const signatureSHA256 = request.headers["x-hub-signature-256"] as string; const id = request.headers["x-github-delivery"] as string; @@ -95,7 +93,7 @@ export async function middleware( await webhooks.verifyAndReceive({ id: id, - name: eventName as any, + name: eventName, payload, signature: signatureSHA256, }); diff --git a/src/types.ts b/src/types.ts index 8a371b2a..741ab757 100644 --- a/src/types.ts +++ b/src/types.ts @@ -25,7 +25,7 @@ export type EmitterWebhookEvent< export type EmitterWebhookEventWithStringPayloadAndSignature = { id: string; - name: WebhookEventName; + name: string; payload: string; signature: string; };