Skip to content

Commit c02f3cf

Browse files
committed
exclude pr comment
1 parent ceb130f commit c02f3cf

1 file changed

Lines changed: 10 additions & 4 deletions

File tree

src/acigithub/issues.go

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,19 @@ func GetIssueComments(issueNumber int) (issueComments []*github.IssueComment, er
2525
issueComments, _, err = GithubClient.Issues.ListComments(ctx, owner, repo, issueNumber, commentOpts)
2626

2727
if err == nil {
28-
icCount := len(issueComments)
28+
var issueCommentsFiltered []*github.IssueComment
29+
for _, issueComment := range issueComments {
30+
if !strings.HasPrefix(*issueComment.Body, `<details><summary>Possible awesome-ci commands for this Pull Request</summary>`) {
31+
issueCommentsFiltered = append(issueCommentsFiltered, issueComment)
32+
}
33+
}
34+
35+
icCount := len(issueCommentsFiltered)
2936
issueCommentsSorted := make([]*github.IssueComment, icCount)
3037

31-
for i, n := range issueComments {
38+
for i, issueComment := range issueCommentsFiltered {
3239
j := icCount - i - 1
33-
34-
issueCommentsSorted[j] = n
40+
issueCommentsSorted[j] = issueComment
3541
}
3642

3743
return issueCommentsSorted, err

0 commit comments

Comments
 (0)