github-api
github-api copied to clipboard
Enhancement: ParseEventPayload: Parse the event type automatically
Hi, I noticed the following documentation on GitHub#parseEventPayload:
[...] Unfortunately, hook script payloads aren't self-descriptive, so you need to know the type of payload you are expecting.
As far as I see, the event type is present within x-github-event header of the incoming hook request.
As stated here:

I've checked the request and the event name does really match the ones available on the aforementioned page.
Could we match the event type strings to GHEventPayload implementations so we don't have to provide the type?
P.S. Thanks for the great library! ❤️
I might be able to raise a PR if you're interested.