async function updateExistingComment()

in src/github/operations/comments/feedback.ts [189:216]


async function updateExistingComment(
    octokit: Octokit,
    context: JunieExecutionContext,
    commentId: number,
    body: string,
    ownerLogin: string,
    repoName: string,
): Promise<void> {
    console.log(`Updating existing comment ${commentId} with new content`);

    if (isPullRequestReviewCommentEvent(context)) {
        await octokit.rest.pulls.updateReviewComment({
            owner: ownerLogin,
            repo: repoName,
            comment_id: commentId,
            body: body,
        });
    } else {
        await octokit.rest.issues.updateComment({
            owner: ownerLogin,
            repo: repoName,
            comment_id: commentId,
            body: body,
        });
    }

    console.log(`Updated comment with ID: ${commentId}`);
}