in docbot/action.go [246:270]
func (a *Action) getLabelInvalidCommentIDs(body string) ([]int64, error) {
ctx := context.Background()
listOptions := &github.IssueListCommentsOptions{}
listOptions.PerPage = 100
commentIDs := make([]int64, 0)
for {
comments, resp, err := a.client.Issues.ListComments(ctx, a.config.GetOwner(), a.config.GetRepo(),
a.prNumber, listOptions)
if err != nil {
return nil, err
}
for _, item := range comments {
if strings.Contains(*item.Body, body) {
commentIDs = append(commentIDs, *item.ID)
}
}
if resp.NextPage == 0 {
break
}
listOptions.Page = resp.NextPage
}
return commentIDs, nil
}