Browse Source

Make a distinction between closed and merged GitHub PRs

Signed-off-by: Isaiah Inuwa <isaiah.inuwa@gmail.com>
pull/337/head
Isaiah Inuwa 4 years ago
parent
commit
f5376156ba
No known key found for this signature in database GPG Key ID: DB6337324CBE1A7
  1. 8
      services/github/webhook/webhook.go

8
services/github/webhook/webhook.go

@ -155,11 +155,17 @@ func pullRequestHTMLMessage(p github.PullRequestEvent) string {
if p.PullRequest.Assignee != nil && p.PullRequest.Assignee.Login != nil {
actionTarget = fmt.Sprintf(" to %s", *p.PullRequest.Assignee.Login)
}
var prAction = *p.Action
if prAction == "closed" && *p.PullRequest.Merged {
prAction = "merged"
}
return fmt.Sprintf(
"[<u>%s</u>] %s %s <b>pull request #%d</b>: %s [%s]%s - %s",
html.EscapeString(*p.Repo.FullName),
html.EscapeString(*p.Sender.Login),
html.EscapeString(*p.Action),
html.EscapeString(prAction),
*p.Number,
html.EscapeString(*p.PullRequest.Title),
html.EscapeString(*p.PullRequest.State),

Loading…
Cancel
Save