diff --git a/packages/plugins/scm-github/src/index.ts b/packages/plugins/scm-github/src/index.ts index c1868e812..e4236615f 100644 --- a/packages/plugins/scm-github/src/index.ts +++ b/packages/plugins/scm-github/src/index.ts @@ -370,6 +370,7 @@ function createGitHubSCM(): SCM { return threads .filter((t) => { + if (t.isResolved) return false; // only pending (unresolved) threads const c = t.comments.nodes[0]; if (!c) return false; // skip threads with no comments const author = c.author?.login ?? ""; diff --git a/packages/plugins/scm-github/test/index.test.ts b/packages/plugins/scm-github/test/index.test.ts index 56731ab73..34404913d 100644 --- a/packages/plugins/scm-github/test/index.test.ts +++ b/packages/plugins/scm-github/test/index.test.ts @@ -432,7 +432,7 @@ describe("scm-github plugin", () => { }; } - it("returns non-bot comments with isResolved from GraphQL", async () => { + it("returns only unresolved non-bot comments from GraphQL", async () => { mockGh( makeGraphQLThreads([ { isResolved: false, id: "C1", author: "alice", body: "Fix line 10", path: "src/foo.ts", line: 10, url: "https://github.com/c/1", createdAt: "2025-01-01T00:00:00Z" }, @@ -441,9 +441,8 @@ describe("scm-github plugin", () => { ); const comments = await scm.getPendingComments(pr); - expect(comments).toHaveLength(2); + expect(comments).toHaveLength(1); expect(comments[0]).toMatchObject({ id: "C1", author: "alice", isResolved: false }); - expect(comments[1]).toMatchObject({ id: "C2", author: "bob", isResolved: true }); }); it("filters out bot comments", async () => {