From 7a4bb23150d3ce6fd74fe50669302d7c76af1613 Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Thu, 14 Nov 2019 09:39:37 +0800 Subject: [PATCH] fix comment content --- modules/notification/action/action.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/modules/notification/action/action.go b/modules/notification/action/action.go index 05b859530..36035b864 100644 --- a/modules/notification/action/action.go +++ b/modules/notification/action/action.go @@ -124,7 +124,6 @@ func (a *actionNotifier) NotifyPullRequestReview(pr *models.PullRequest, review log.Error("LoadReviewer '%d/%d': %v", review.ID, review.ReviewerID, err) return } - var content = comment.Content if err := review.LoadCodeComments(); err != nil { log.Error("LoadCodeComments '%d/%d': %v", review.Reviewer.ID, review.ID, err) return @@ -137,7 +136,7 @@ func (a *actionNotifier) NotifyPullRequestReview(pr *models.PullRequest, review actions = append(actions, &models.Action{ ActUserID: review.Reviewer.ID, ActUser: review.Reviewer, - Content: fmt.Sprintf("%d|%s", review.Issue.Index, strings.Split(content, "\n")[0]), + Content: fmt.Sprintf("%d|%s", review.Issue.Index, strings.Split(comm.Content, "\n")[0]), OpType: models.ActionCommentIssue, RepoID: review.Issue.RepoID, Repo: review.Issue.Repo, @@ -153,7 +152,7 @@ func (a *actionNotifier) NotifyPullRequestReview(pr *models.PullRequest, review actions = append(actions, &models.Action{ ActUserID: review.Reviewer.ID, ActUser: review.Reviewer, - Content: fmt.Sprintf("%d|%s", review.Issue.Index, strings.Split(content, "\n")[0]), + Content: fmt.Sprintf("%d|%s", review.Issue.Index, strings.Split(comment.Content, "\n")[0]), OpType: models.ActionCommentIssue, RepoID: review.Issue.RepoID, Repo: review.Issue.Repo,