fix(check): key check_run in-place edits on check name + head_sha

Providers that emit a fresh check run id per phase (e.g. Cloudflare Pages)
no longer post a new message for each status change; same name + commit
SHA now edits the existing message. Falls back to the run id when name or
head_sha is absent. Docs updated in sync.
This commit is contained in:
RhenCloud 2026-08-31 01:17:13 +08:00
parent cc8bb4182f
commit fd6ccda411
No known key found for this signature in database
GPG key ID: A574A617378C4E0B
9 changed files with 47 additions and 8 deletions

View file

@ -183,6 +183,39 @@ describe("message title spec", () => {
expect(msg.updateKey).toBeUndefined();
});
it("check_run keys on name + head_sha for stable in-place edits", () => {
const running = formatEvent(
route,
event("check_run", {
check_run: {
id: 42,
name: "Cloudflare Pages",
head_sha: "abc123def456",
status: "in_progress",
conclusion: null,
},
repository: repo,
sender,
}),
);
const failed = formatEvent(
route,
event("check_run", {
check_run: {
id: 43,
name: "Cloudflare Pages",
head_sha: "abc123def456",
status: "completed",
conclusion: "failure",
},
repository: repo,
sender,
}),
);
expect(running.updateKey).toBe("check_run:acme/widget:Cloudflare Pages:abc123def456");
expect(failed.updateKey).toBe(running.updateKey);
});
it("check_suite shows conclusion, service, branch and commit", () => {
const suite = {
html_url: "https://github.com/acme/widget/runs/2",