Skip to content

Commit 0bc39f9

Browse files
committed
Prefer last comment when there are multiple to choose from
1 parent a587867 commit 0bc39f9

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

‎pr-checks/post-comment.test.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ describe("findExistingComment", async () => {
193193
1,
194194
"marker",
195195
);
196-
assert.equal(id, 2);
196+
assert.equal(id, 3);
197197
});
198198

199199
await it("returns undefined when no comment matches", async () => {

‎pr-checks/post-comment.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ export async function findExistingComment(
112112
"Use a unique marker for each distinct managed comment to avoid this situation.",
113113
);
114114
}
115-
return markedComments[0]?.id;
115+
return markedComments.at(-1)?.id;
116116
}
117117

118118
/**

0 commit comments

Comments
 (0)