Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
omerzi committed Sep 11, 2023
1 parent 68481c5 commit 9334e94
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions vcsclient/github.go
Original file line number Diff line number Diff line change
Expand Up @@ -444,6 +444,11 @@ func (client *GitHubClient) AddPullRequestReviewComments(ctx context.Context, ow

for _, comment := range comments {
filePath := strings.TrimPrefix(comment.NewFilePath, string(os.PathSeparator))
startLine := &comment.NewStartLine
// GitHub API won't accept 'start_line' if it equals the end line
if *startLine == comment.NewEndLine {
startLine = nil
}
if _, _, err = ghClient.PullRequests.CreateComment(ctx, owner, repository, pullRequestID, &github.PullRequestComment{
CommitID: &latestCommitSHA,
Body: &comment.Content,
Expand Down

0 comments on commit 9334e94

Please sign in to comment.