Skip to content

Commit

Permalink
github-bots: add new botName field to AddComment signature so it work…
Browse files Browse the repository at this point in the history
…s like SetComment. This helps fetch and identify all comments from specific bots

Signed-off-by: James Rawlings <[email protected]>
  • Loading branch information
rawlingsj committed Jan 6, 2025
1 parent 2474153 commit 6977ab3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion modules/github-bots/sdk/github.go
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,8 @@ func (c GitHubClient) SetComment(ctx context.Context, pr *github.PullRequest, bo
}

// AddComment adds a new comment to the given pull request.
func (c GitHubClient) AddComment(ctx context.Context, pr *github.PullRequest, content string) error {
func (c GitHubClient) AddComment(ctx context.Context, pr *github.PullRequest, botName, content string) error {
content = fmt.Sprintf("<!-- bot:%s -->\n\n%s", botName, content)
if _, resp, err := c.inner.Issues.CreateComment(ctx, *pr.Base.Repo.Owner.Login, *pr.Base.Repo.Name, *pr.Number, &github.IssueComment{
Body: &content,
}); err != nil || resp.StatusCode != 201 {
Expand Down

0 comments on commit 6977ab3

Please sign in to comment.