diff --git a/pr-checks/post-comment.test.ts b/pr-checks/post-comment.test.ts index 63e0f6caa..8bef06104 100644 --- a/pr-checks/post-comment.test.ts +++ b/pr-checks/post-comment.test.ts @@ -193,7 +193,7 @@ describe("findExistingComment", async () => { 1, "marker", ); - assert.equal(id, 2); + assert.equal(id, 3); }); await it("returns undefined when no comment matches", async () => { diff --git a/pr-checks/post-comment.ts b/pr-checks/post-comment.ts index b9081c5a1..cb8debaa9 100644 --- a/pr-checks/post-comment.ts +++ b/pr-checks/post-comment.ts @@ -112,7 +112,7 @@ export async function findExistingComment( "Use a unique marker for each distinct managed comment to avoid this situation.", ); } - return markedComments[0]?.id; + return markedComments.at(-1)?.id; } /**