(p *api.IssueCommentPayload)
| 186 | } |
| 187 | |
| 188 | func getDingtalkIssueCommentPayload(p *api.IssueCommentPayload) *DingtalkPayload { |
| 189 | issueName := fmt.Sprintf("#%d %s", p.Issue.Index, p.Issue.Title) |
| 190 | commentURL := fmt.Sprintf("%s/issues/%d", p.Repository.HTMLURL, p.Issue.Index) |
| 191 | if p.Action != api.HOOK_ISSUE_COMMENT_DELETED { |
| 192 | commentURL += "#" + CommentHashTag(p.Comment.ID) |
| 193 | } |
| 194 | |
| 195 | issueURL := fmt.Sprintf("%s/issues/%d", p.Repository.HTMLURL, p.Issue.Index) |
| 196 | |
| 197 | actionCard := NewDingtalkActionCard("View Issue Comment", commentURL) |
| 198 | actionCard.Text += "# Issue Comment " + strings.Title(string(p.Action)) |
| 199 | actionCard.Text += "\n- Issue: " + MarkdownLinkFormatter(issueURL, issueName) |
| 200 | actionCard.Text += "\n- Comment content: " |
| 201 | actionCard.Text += "\n> " + p.Comment.Body |
| 202 | |
| 203 | return &DingtalkPayload{ |
| 204 | MsgType: "actionCard", |
| 205 | ActionCard: actionCard, |
| 206 | } |
| 207 | } |
| 208 | |
| 209 | func getDingtalkPullRequestPayload(p *api.PullRequestPayload) *DingtalkPayload { |
| 210 | title := "# Pull Request " + strings.Title(string(p.Action)) |
no test coverage detected