Split func handling pull_request events

This commit is contained in:
Zero King
2017-07-13 12:40:00 +00:00
parent 8ff6f2dd07
commit fd304e6c15
2 changed files with 14 additions and 0 deletions
+6
View File
@@ -0,0 +1,6 @@
package webhook
func handlePullRequest(body []byte) {
// Use |= for openmaintainer/nomaintainer (init 1) flag, nomaintainer take precedence
// Loop over ports and aggregate related maintainers
}
+8
View File
@@ -48,6 +48,14 @@ func (receiver *Receiver) Start() {
return
}
switch r.Header.Get("X-GitHub-Event") {
case "":
w.WriteHeader(http.StatusBadRequest)
return
case "pull_request":
go handlePullRequest(body)
}
w.WriteHeader(http.StatusNoContent)
})