Skip to content

Commit ae1f3ff

Browse files
committed
docs: document <event>.<action> where applicable
1 parent 1891034 commit ae1f3ff

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ source.onmessage = (event) => {
9292
6. [webhooks.on()](#webhookson)
9393
7. [webhooks.onAny()](#webhooksonany)
9494
8. [webhooks.onError()](#webhooksonerror)
95-
9. [webhooks.removeListener()](#webhooksremoveListener)
95+
9. [webhooks.removeListener()](#webhooksremovelistener)
9696
10. [webhooks.middleware()](#webhooksmiddleware)
9797
11. [Webhook events](#webhook-events)
9898

@@ -376,7 +376,7 @@ webhooks.on(eventNames, handler);
376376
</td>
377377
<td>
378378
<strong>Required.</strong>
379-
Name of the event. One of <a href="https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads">GitHub's supported event names</a>.
379+
Name of the event. One of <a href="#webhook-events">GitHub's supported event names</a>, or (if the event has an action property) the name of an event followed by its action in the form of <code>&lt;event>.&lt;action></code>.
380380
</td>
381381
</tr>
382382
<tr>
@@ -490,7 +490,7 @@ webhooks.removeListener(eventNames, handler);
490490
</td>
491491
<td>
492492
<strong>Required.</strong>
493-
Name of the event. One of <a href="https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads">GitHubs supported event names</a>, or '*' for the <code>onAny()</code> method or 'error' for the <code>onError()</code> method.
493+
Name of the event. One of <a href="#webhook-events">GitHub's supported event names</a>, or (if the event has an action property) the name of an event followed by its action in the form of <code>&lt;event>.&lt;action></code>, or '*' for the <code>onAny()</code> method or 'error' for the <code>onError()</code> method.
494494
</td>
495495
</tr>
496496
<tr>
@@ -654,12 +654,12 @@ Note that changes to the exported types are not considered breaking changes, as
654654

655655
### `EmitterWebhookEventName`
656656

657-
A union of all possible events supported by the event emitter.
657+
A union of all possible events and event/action combinations supported by the event emitter, e.g. `"check_run" | "check_run.completed" | ... many more ... | "workflow_run.requested"`.
658658

659659
### `EmitterWebhookEvent`
660660

661661
The object that is emitted by `@octokit/webhooks` as an event; made up of an `id`, `name`, and `payload` properties.
662-
An optional generic parameter can be passed to narrow the type of the `payload` property to be based on the `name` of the event.
662+
An optional generic parameter can be passed to narrow the type of the `name` and `payload` properties based on event names or event/action combinations, e.g. `EmitterWebhookEvent<"check_run.completed" | "code_scanning_alert.fixed">`.
663663

664664
## License
665665

0 commit comments

Comments
 (0)