mirror of
https://github.com/ReCloudStudio/WebHooker.git
synced 2026-09-23 00:21:28 +00:00
feat: support check_suite webhook events
This commit is contained in:
parent
7179a35457
commit
fb9550b94d
6 changed files with 115 additions and 2 deletions
|
|
@ -150,6 +150,26 @@ describe("message title spec", () => {
|
|||
expect(msg.fields![0].value).toBe("🔄 running");
|
||||
});
|
||||
|
||||
it("check_suite shows conclusion, service, branch and commit", () => {
|
||||
const suite = {
|
||||
html_url: "https://github.com/acme/widget/runs/2",
|
||||
conclusion: "success",
|
||||
status: "completed",
|
||||
app: { name: "Cloudflare Pages" },
|
||||
head_branch: "main",
|
||||
head_sha: "abc123def456",
|
||||
};
|
||||
const msg = formatEvent(
|
||||
route,
|
||||
event("check_suite", { check_suite: suite, repository: repo, sender }),
|
||||
);
|
||||
expect(msg.title).toBe("acme/widget: Check suite success");
|
||||
expect(msg.fields![0].value).toBe("✅ success");
|
||||
expect(msg.fields![1].value).toBe("Cloudflare Pages");
|
||||
expect(msg.fields![2].value).toBe("main");
|
||||
expect(msg.fields![3].value).toBe("abc123d");
|
||||
});
|
||||
|
||||
it("unknown events fall back to repo: event: action", () => {
|
||||
const msg = formatEvent(
|
||||
route,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue