From 05ba571f34390caeeaa3dfbcae95d739edb7ba27 Mon Sep 17 00:00:00 2001 From: Chris Sexton Date: Mon, 9 Nov 2020 03:31:41 -0500 Subject: [PATCH] github: fix github event URLs and owners --- plugins/git/github.go | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/plugins/git/github.go b/plugins/git/github.go index ef9ce33..2e6f8c4 100644 --- a/plugins/git/github.go +++ b/plugins/git/github.go @@ -73,7 +73,7 @@ func (p *GitPlugin) githubEvent(w http.ResponseWriter, r *http.Request) { pr.PullRequest.User.Login, pr.PullRequest.Title, pr.Repository.Name, - pr.PullRequest.URL, + pr.PullRequest.HTMLURL, ) case github.PingPayload: ping := payload.(github.PingPayload) @@ -97,12 +97,12 @@ func (p *GitPlugin) githubEvent(w http.ResponseWriter, r *http.Request) { return sendCommentEvent: repo = cmt.Repository.Name - owner = cmt.Comment.User.Login + owner = cmt.Repository.Owner.Login msg += fmt.Sprintf("%s %s %s on <%s|%s #%d>", icon, - owner, + cmt.Issue.User.Login, action, - cmt.Issue.URL, + cmt.Issue.HTMLURL, cmt.Issue.Title, cmt.Issue.Number, ) @@ -124,12 +124,12 @@ func (p *GitPlugin) githubEvent(w http.ResponseWriter, r *http.Request) { return sendIssueEvent: repo = issueEvent.Repository.Name - owner = issueEvent.Sender.Login + owner = issueEvent.Repository.Owner.Login msg += fmt.Sprintf("%s %s %s issue <%s|%s #%d>", icon, - owner, + issueEvent.Issue.User.Login, action, - issueEvent.Issue.URL, + issueEvent.Issue.HTMLURL, issueEvent.Issue.Title, issueEvent.Issue.Number, )