Not all GitHub Events are sent via webhooks. Some are only available to GitHub Actions, such as the schedule event.
I would like to move all event-related logic into a new @octokit/events package. It will essentially be EventHandler class from /src/event-handler
@octokit/webhooks should only care about webhooks-specific logic
- sign an event payload using a secret
- verifying an event payload with a signature
- Handle http request lifecycles
With that change, we should rename the @octokit/webhooks-definitions to @octokit/events-defintions, too. The definitions should include a flag whether an event is also sent as a Webhook request by GitHub.
This is also a good opportunity to clean up the code base. @octokit/webhooks is one of the olders @octokit modules, a lot has change since, most importantly the rewrite to TypeScript. When creating @octokit/events, we can start with a blank page and do not need to worry about breaking any APIs. Once the module is done, we will be able to remove a big chunk of the code in @octokit/webhooks and instead replace it with the @octokit/events dependency. We can release a breaking change for @octokit/webhooks if necessary at this point.
This will be a larger effort that I need to be involved in, but it's not time critical. If anyone would like to take a lead on the effort, let's discuss in the comments
Not all GitHub Events are sent via webhooks. Some are only available to GitHub Actions, such as the
scheduleevent.I would like to move all event-related logic into a new
@octokit/eventspackage. It will essentially beEventHandlerclass from /src/event-handler@octokit/webhooksshould only care about webhooks-specific logicWith that change, we should rename the
@octokit/webhooks-definitionsto@octokit/events-defintions, too. The definitions should include a flag whether an event is also sent as a Webhook request by GitHub.This is also a good opportunity to clean up the code base.
@octokit/webhooksis one of the olders @octokit modules, a lot has change since, most importantly the rewrite to TypeScript. When creating@octokit/events, we can start with a blank page and do not need to worry about breaking any APIs. Once the module is done, we will be able to remove a big chunk of the code in@octokit/webhooksand instead replace it with the@octokit/eventsdependency. We can release a breaking change for@octokit/webhooksif necessary at this point.This will be a larger effort that I need to be involved in, but it's not time critical. If anyone would like to take a lead on the effort, let's discuss in the comments