Skip to content

Class: GithubWebhookStreamSource<TEvent> ​

Defined in: github/src/executors/github-webhook-stream.ts:24

Runtime StreamSource implementation for GithubWebhookStreamNode (github:webhook-stream).

Listens for HTTP POST webhook deliveries, enforces a 10 MiB body limit (413), verifies X-Hub-Signature-256 via @octokit/webhooks, filters by event/repo, and invokes onEvent.

Type Parameters ​

Type ParameterDefault typeDescription
TEventunknownWebhook event payload type.

Implements ​

Constructors ​

Constructor ​

ts
new GithubWebhookStreamSource<TEvent>(node, ctx): GithubWebhookStreamSource<TEvent>;

Defined in: github/src/executors/github-webhook-stream.ts:48

Initializes a new GithubWebhookStreamSource for node and ctx.

Pre-indexes node.events into a Set at construction time per Rule 4.2.

Parameters ​

ParameterTypeDescription
nodeGithubWebhookStreamNode<TEvent>Passive GitHub webhook stream AST node.
ctxRuntimeDriverContextRuntime driver context.

Returns ​

GithubWebhookStreamSource<TEvent>

Methods ​

getBoundPort() ​

ts
getBoundPort(): number | undefined;

Defined in: github/src/executors/github-webhook-stream.ts:61

Returns the currently bound local TCP listener port when the webhook server is active.

Useful when node.port is configured as 0 for ephemeral port assignment in tests.

Returns ​

number | undefined

Bound TCP port number, or undefined when not listening.


subscribe() ​

ts
subscribe(onEvent): Promise<StreamSubscriptionHandle>;

Defined in: github/src/executors/github-webhook-stream.ts:76

Starts the local HTTP webhook listener and subscribes onEvent to verified matching deliveries.

Resolves node.secret via ctx.resolveEnv, initializes @octokit/webhooks, and binds to 127.0.0.1.

Parameters ​

ParameterTypeDescription
onEvent(event) => Promise<void>Async callback invoked for each verified matching webhook event.

Returns ​

Promise<StreamSubscriptionHandle>

Handle with .close() to shut down the HTTP listener.

Throws ​

If already subscribed, secret resolution fails, or port binding fails.

Implementation of ​

StreamSource.subscribe

Released under the MIT License.