mirror of
https://github.com/github/codeql-action.git
synced 2026-11-10 14:56:01 +00:00
Prefer last comment when there are multiple to choose from
This commit is contained in:
@@ -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 () => {
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user