@@ -84,11 +84,13 @@ func getPullRequestPayloadInfo(p *api.PullRequestPayload, linkFormatter linkForm
84
84
issueTitle := fmt .Sprintf ("#%d %s" , p .Index , p .PullRequest .Title )
85
85
titleLink := linkFormatter (p .PullRequest .URL , issueTitle )
86
86
var text string
87
+ var attachmentText string
87
88
color := yellowColor
88
89
89
90
switch p .Action {
90
91
case api .HookIssueOpened :
91
92
text = fmt .Sprintf ("[%s] Pull request opened: %s" , repoLink , titleLink )
93
+ attachmentText = p .PullRequest .Body
92
94
color = greenColor
93
95
case api .HookIssueClosed :
94
96
if p .PullRequest .HasMerged {
@@ -102,6 +104,7 @@ func getPullRequestPayloadInfo(p *api.PullRequestPayload, linkFormatter linkForm
102
104
text = fmt .Sprintf ("[%s] Pull request re-opened: %s" , repoLink , titleLink )
103
105
case api .HookIssueEdited :
104
106
text = fmt .Sprintf ("[%s] Pull request edited: %s" , repoLink , titleLink )
107
+ attachmentText = p .PullRequest .Body
105
108
case api .HookIssueAssigned :
106
109
list := make ([]string , len (p .PullRequest .Assignees ))
107
110
for i , user := range p .PullRequest .Assignees {
@@ -126,16 +129,12 @@ func getPullRequestPayloadInfo(p *api.PullRequestPayload, linkFormatter linkForm
126
129
text = fmt .Sprintf ("[%s] Pull request milestone cleared: %s" , repoLink , titleLink )
127
130
case api .HookIssueReviewed :
128
131
text = fmt .Sprintf ("[%s] Pull request reviewed: %s" , repoLink , titleLink )
132
+ attachmentText = p .Review .Content
129
133
}
130
134
if withSender {
131
135
text += fmt .Sprintf (" by %s" , linkFormatter (setting .AppURL + p .Sender .UserName , p .Sender .UserName ))
132
136
}
133
137
134
- var attachmentText string
135
- if p .Action == api .HookIssueOpened || p .Action == api .HookIssueEdited {
136
- attachmentText = p .PullRequest .Body
137
- }
138
-
139
138
return text , issueTitle , attachmentText , color
140
139
}
141
140
0 commit comments