mirror of
https://github.com/anthropics/claude-code-action.git
synced 2026-01-22 22:44:13 +08:00
feat: exclude hidden (minimized) comments from GitHub Issues and PRs (#368)
* feat: ignore minimized comments * fix tests
This commit is contained in:
committed by
GitHub
parent
5bdc533a52
commit
fd012347a2
@@ -46,6 +46,7 @@ export const PR_QUERY = `
|
||||
login
|
||||
}
|
||||
createdAt
|
||||
isMinimized
|
||||
}
|
||||
}
|
||||
reviews(first: 100) {
|
||||
@@ -69,6 +70,7 @@ export const PR_QUERY = `
|
||||
login
|
||||
}
|
||||
createdAt
|
||||
isMinimized
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -98,6 +100,7 @@ export const ISSUE_QUERY = `
|
||||
login
|
||||
}
|
||||
createdAt
|
||||
isMinimized
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -134,7 +134,7 @@ export async function fetchGitHubData({
|
||||
|
||||
// Prepare all comments for image processing
|
||||
const issueComments: CommentWithImages[] = comments
|
||||
.filter((c) => c.body)
|
||||
.filter((c) => c.body && !c.isMinimized)
|
||||
.map((c) => ({
|
||||
type: "issue_comment" as const,
|
||||
id: c.databaseId,
|
||||
@@ -154,7 +154,7 @@ export async function fetchGitHubData({
|
||||
const reviewComments: CommentWithImages[] =
|
||||
reviewData?.nodes
|
||||
?.flatMap((r) => r.comments?.nodes ?? [])
|
||||
.filter((c) => c.body)
|
||||
.filter((c) => c.body && !c.isMinimized)
|
||||
.map((c) => ({
|
||||
type: "review_comment" as const,
|
||||
id: c.databaseId,
|
||||
|
||||
@@ -50,6 +50,7 @@ export function formatComments(
|
||||
imageUrlMap?: Map<string, string>,
|
||||
): string {
|
||||
return comments
|
||||
.filter((comment) => !comment.isMinimized)
|
||||
.map((comment) => {
|
||||
let body = comment.body;
|
||||
|
||||
@@ -96,6 +97,7 @@ export function formatReviewComments(
|
||||
review.comments.nodes.length > 0
|
||||
) {
|
||||
const comments = review.comments.nodes
|
||||
.filter((comment) => !comment.isMinimized)
|
||||
.map((comment) => {
|
||||
let body = comment.body;
|
||||
|
||||
@@ -110,7 +112,9 @@ export function formatReviewComments(
|
||||
return ` [Comment on ${comment.path}:${comment.line || "?"}]: ${body}`;
|
||||
})
|
||||
.join("\n");
|
||||
reviewOutput += `\n${comments}`;
|
||||
if (comments) {
|
||||
reviewOutput += `\n${comments}`;
|
||||
}
|
||||
}
|
||||
|
||||
return reviewOutput;
|
||||
|
||||
@@ -10,6 +10,7 @@ export type GitHubComment = {
|
||||
body: string;
|
||||
author: GitHubAuthor;
|
||||
createdAt: string;
|
||||
isMinimized?: boolean;
|
||||
};
|
||||
|
||||
export type GitHubReviewComment = GitHubComment & {
|
||||
|
||||
Reference in New Issue
Block a user