You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It looks like go-github has an internal list of all the GitHub event types . I'd like to be able to iterate over the list in my own code where I route events based on event type. I'm thinking of exposing the following methods:
// WebhookTypes returns a list of all the known GitHub event type strings supported by go-github.funcWebhookTypes() []string {
// ...
}
// EventForType returns an empty struct matching the specified GitHub event type.funcEventForType(messageTypestring) any {
}
I have no problem with that as long as you can refactor to reuse existing code as much as possible.
I say this because any time a new PR comes in to support a new webhook event type, it is a bit of a pain to make sure you tweak all the various places that need tweaking, and it would be nice to not add more pain to this process.
It looks like
go-github
has an internal list of all the GitHub event types . I'd like to be able to iterate over the list in my own code where I route events based on event type. I'm thinking of exposing the following methods:The second method would extract a lot of
Event.ParsePayload
https://github.com/google/go-github/blob/master/github/event.go#L30, so it wouldn't be much additional code.The text was updated successfully, but these errors were encountered: