This commit is contained in:
Mark Wylde
2025-05-30 20:02:39 +01:00
parent 180a1b6680
commit fb6df649ed
33 changed files with 4709 additions and 901 deletions

View File

@@ -10,14 +10,14 @@ import {
createBranchLink,
createCommentBody,
} from "./common";
import { type Octokits } from "../../api/client";
import { type GitHubClient } from "../../api/client";
import {
isPullRequestReviewCommentEvent,
type ParsedGitHubContext,
} from "../../context";
export async function updateTrackingComment(
octokit: Octokits,
client: GitHubClient,
context: ParsedGitHubContext,
commentId: number,
branch?: string,
@@ -38,21 +38,17 @@ export async function updateTrackingComment(
try {
if (isPullRequestReviewCommentEvent(context)) {
// For PR review comments (inline comments), use the pulls API
await octokit.rest.pulls.updateReviewComment({
owner,
repo,
comment_id: commentId,
body: updatedBody,
});
await client.api.customRequest(
"PATCH",
`/api/v1/repos/${owner}/${repo}/pulls/comments/${commentId}`,
{
body: updatedBody,
},
);
console.log(`✅ Updated PR review comment ${commentId} with branch link`);
} else {
// For all other comments, use the issues API
await octokit.rest.issues.updateComment({
owner,
repo,
comment_id: commentId,
body: updatedBody,
});
await client.api.updateIssueComment(owner, repo, commentId, updatedBody);
console.log(`✅ Updated issue comment ${commentId} with branch link`);
}
} catch (error) {