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 Parameter | Default type | Description |
|---|---|---|
TEvent | unknown | Webhook event payload type. |
Implements
StreamSource<TEvent>
Constructors
Constructor
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
| Parameter | Type | Description |
|---|---|---|
node | GithubWebhookStreamNode<TEvent> | Passive GitHub webhook stream AST node. |
ctx | RuntimeDriverContext | Runtime driver context. |
Returns
GithubWebhookStreamSource<TEvent>
Methods
getBoundPort()
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()
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
| Parameter | Type | Description |
|---|---|---|
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.