git: actually do the thing

This commit is contained in:
Chris Sexton 2019-11-03 07:55:58 -05:00 committed by Chris Sexton
parent 6ada638968
commit d1149e7022
2 changed files with 4 additions and 4 deletions

View File

@ -46,7 +46,7 @@ func (p *GitPlugin) githubEvent(w http.ResponseWriter, r *http.Request) {
m,
)
}
msg = commits
msg += commits
case github.PullRequestPayload:
pr := payload.(github.PullRequestPayload)
if pr.Action != "opened" {
@ -56,7 +56,7 @@ func (p *GitPlugin) githubEvent(w http.ResponseWriter, r *http.Request) {
}
repo = pr.Repository.Name
owner = pr.Repository.Owner.Login
msg = fmt.Sprintf("%s opened new pull request \"%s\" on %s: %s",
msg += fmt.Sprintf("%s opened new pull request \"%s\" on %s: %s",
pr.PullRequest.User.Login,
pr.PullRequest.Title,
pr.Repository.Name,
@ -66,7 +66,7 @@ func (p *GitPlugin) githubEvent(w http.ResponseWriter, r *http.Request) {
ping := payload.(github.PingPayload)
repo = ping.Repository.Name
owner = ping.Repository.Owner.Login
msg = fmt.Sprintf(icon+"Got a ping request on %s", repo)
msg += fmt.Sprintf(icon+"Got a ping request on %s", repo)
default:
log.Error().Interface("payload", payload).Msg("unknown event payload")
w.WriteHeader(500)

View File

@ -44,7 +44,7 @@ func (p *GitPlugin) gitlabEvent(w http.ResponseWriter, r *http.Request) {
m,
)
}
msg = commits
msg += commits
default:
w.WriteHeader(500)
fmt.Fprintf(w, "unknown payload: %+v", payload)