gr2m / github-app-webhook-relay

Receive webhooks from a GitHub repository using websockets amended with an installation key for usage with GitHub Apps
ISC License
4 stars 1 forks source link

Simulate "installation", "installation_repositories", "installation_target" events #6

Open gr2m opened 1 year ago

gr2m commented 1 year ago

By design, the webhook relay cannot subscribe to events that are only supported by apps, because under the hood manual repository hooks and organization hooks are used. See https://github.com/gr2m/github-webhook-relay/#how-it-works

However, we could simulate these events. At least for the installation and installation_repositories events, we could continuously request the GET /repos/{owner}/{repo}/installation endpoint and then emulate the events if an installation was added or removed. We could simulate the installation_target event at the same time and just make up the previous name of the owner.

Alternatively we could add a .simulate() method for these three events and all the other events that are only supported by GitHub apps:

And in some way also ping