From 686ba1d662e5acc42ab4ff93ba8ad3cdcfafe09e Mon Sep 17 00:00:00 2001 From: Chris Sexton Date: Sat, 26 Oct 2019 15:07:37 -0400 Subject: [PATCH] git: only respond to PR opened event Probably will need to check this on other events too. --- plugins/git/git.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/plugins/git/git.go b/plugins/git/git.go index 6c851f3..285a128 100644 --- a/plugins/git/git.go +++ b/plugins/git/git.go @@ -118,6 +118,11 @@ func (p *GitPlugin) githubEvent(w http.ResponseWriter, r *http.Request) { msg = fmt.Sprintf("%s pushed to %s: \n%s", push.Pusher.Name, push.Repository.Name, commits) case github.PullRequestPayload: pr := payload.(github.PullRequestPayload) + if pr.Action != "opened" { + w.WriteHeader(200) + fmt.Fprintf(w, "ignoring action %s", pr.Action) + return + } repo = pr.Repository.Name msg = fmt.Sprintf("%s opened new pull request \"%s\" on %s: %s", pr.PullRequest.User.Login,