Skip to content

Commit

Permalink
fix bitbucket server
Browse files Browse the repository at this point in the history
  • Loading branch information
omerzi committed Sep 12, 2023
1 parent fe9427a commit ade0ec5
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions vcsclient/bitbucketserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -424,9 +424,9 @@ func (client *BitbucketServerClient) addPullRequestComment(ctx context.Context,
return err
}
bitbucketClient := client.buildBitbucketClient(ctx)
anchor := &bitbucketv1.Anchor{}
filePath := vcsutils.GetPullRequestFilePath(comment.NewFilePath)
if filePath != "" {
// Determine the file path and anchor
var anchor *bitbucketv1.Anchor
if filePath := vcsutils.GetPullRequestFilePath(comment.NewFilePath); filePath != "" {
anchor = &bitbucketv1.Anchor{
Line: comment.NewStartLine,
LineType: "CONTEXT",
Expand All @@ -435,11 +435,13 @@ func (client *BitbucketServerClient) addPullRequestComment(ctx context.Context,
SrcPath: filePath,
}
}
_, err = bitbucketClient.CreatePullRequestComment(owner, repository, pullRequestID, bitbucketv1.Comment{

// Create the pull request comment
commentData := bitbucketv1.Comment{
Text: comment.Content,
Anchor: anchor,
}, []string{"application/json"})

}
_, err = bitbucketClient.CreatePullRequestComment(owner, repository, pullRequestID, commentData, []string{"application/json"})
return err
}

Expand Down

0 comments on commit ade0ec5

Please sign in to comment.