[Github] Add installation_repositories event (#55)

I've recently been using your type definitions while playing around with
the Github Webhooks and I realised the `install_repositories` event was
missing. I've added it and updated the tests.
This commit is contained in:
Elliot Maincourt
2019-01-09 05:19:54 +01:00
committed by Dean Karn
parent 80aa7fa2fe
commit bba5196bce
4 changed files with 172 additions and 0 deletions
+5
View File
@@ -36,6 +36,7 @@ const (
ForkEvent Event = "fork"
GollumEvent Event = "gollum"
InstallationEvent Event = "installation"
InstallationRepositoriesEvent Event = "installation_repositories"
IntegrationInstallationEvent Event = "integration_installation"
IssueCommentEvent Event = "issue_comment"
IssuesEvent Event = "issues"
@@ -193,6 +194,10 @@ func (hook Webhook) Parse(r *http.Request, events ...Event) (interface{}, error)
var pl InstallationPayload
err = json.Unmarshal([]byte(payload), &pl)
return pl, err
case InstallationRepositoriesEvent:
var pl InstallationRepositoriesPayload
err = json.Unmarshal([]byte(payload), &pl)
return pl, err
case IssueCommentEvent:
var pl IssueCommentPayload
err = json.Unmarshal([]byte(payload), &pl)