fix: bound github issue comment views (#915)

Co-authored-by: Codex <codex@noreply.local>
This commit is contained in:
Lyon
2026-06-26 00:57:39 +08:00
committed by GitHub
parent 29f80935bf
commit 08e6ee575b
7 changed files with 77 additions and 12 deletions
+6 -1
View File
@@ -5,13 +5,18 @@ import { bodySha, preview, previewLines } from "./auth-and-safety";
import type { GitHubComment } from "./types";
export function commentSummary(comment: GitHubComment): Record<string, unknown> {
const body = comment.body ?? "";
return {
id: comment.id,
body: comment.body ?? "",
body,
url: comment.html_url,
author: comment.user?.login ?? null,
createdAt: comment.created_at ?? null,
updatedAt: comment.updated_at ?? null,
bodyChars: body.length,
bodySha: bodySha(body),
bodyOmitted: false,
fullBodyIncluded: true,
};
}