mirror of
https://github.com/ReCloudStudio/WebHooker.git
synced 2026-09-22 16:11:29 +00:00
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:
parent
cc8bb4182f
commit
fd6ccda411
9 changed files with 47 additions and 8 deletions
|
|
@ -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",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue