Skip to content

Commit 524ed0d

Browse files
authored
feat(schemas): added schema for the merge_group destroyed event (#962)
1 parent 927e57f commit 524ed0d

File tree

2 files changed

+135
-1
lines changed

2 files changed

+135
-1
lines changed
Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
{
2+
"$schema": "http://json-schema.org/draft-07/schema#",
3+
"$id": "merge_group$destroyed",
4+
"type": "object",
5+
"required": ["action", "merge_group", "reason", "repository", "sender"],
6+
"properties": {
7+
"action": { "type": "string", "enum": ["destroyed"] },
8+
"merge_group": {
9+
"type": "object",
10+
"description": "The merge group.",
11+
"required": [
12+
"head_sha",
13+
"head_ref",
14+
"base_ref",
15+
"base_sha",
16+
"head_commit"
17+
],
18+
"properties": {
19+
"head_sha": {
20+
"type": "string",
21+
"description": "The SHA of the merge group."
22+
},
23+
"head_ref": {
24+
"type": "string",
25+
"description": "The full ref of the merge group."
26+
},
27+
"base_ref": {
28+
"type": "string",
29+
"description": "The full ref of the branch the merge group will be merged into."
30+
},
31+
"base_sha": {
32+
"type": "string",
33+
"description": "The SHA of the merge group's parent commit."
34+
},
35+
"head_commit": {
36+
"type": "object",
37+
"description": "An expanded representation of the `head_sha` commit.",
38+
"required": [
39+
"id",
40+
"tree_id",
41+
"message",
42+
"timestamp",
43+
"author",
44+
"committer"
45+
],
46+
"properties": {
47+
"id": { "type": "string" },
48+
"tree_id": { "type": "string" },
49+
"message": { "type": "string" },
50+
"timestamp": { "type": "string", "format": "date-time" },
51+
"author": {
52+
"type": "object",
53+
"required": ["name", "email"],
54+
"properties": {
55+
"name": { "type": "string" },
56+
"email": { "type": "string" }
57+
},
58+
"additionalProperties": false
59+
},
60+
"committer": {
61+
"type": "object",
62+
"required": ["name", "email"],
63+
"properties": {
64+
"name": { "type": "string" },
65+
"email": { "type": "string" }
66+
},
67+
"additionalProperties": false
68+
}
69+
},
70+
"additionalProperties": false
71+
}
72+
},
73+
"additionalProperties": false
74+
},
75+
"reason": {
76+
"type": "string",
77+
"enum": ["dequeued", "invalidated", "merged"]
78+
},
79+
"repository": { "$ref": "common/repository.schema.json" },
80+
"sender": { "$ref": "common/user.schema.json" },
81+
"installation": { "$ref": "common/installation-lite.schema.json" },
82+
"organization": { "$ref": "common/organization.schema.json" }
83+
},
84+
"additionalProperties": false,
85+
"title": "merge group destroyed event"
86+
}

payload-types/schema.d.ts

Lines changed: 49 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,9 @@ export type MemberEvent =
199199
| MemberEditedEvent
200200
| MemberRemovedEvent;
201201
export type MembershipEvent = MembershipAddedEvent | MembershipRemovedEvent;
202-
export type MergeGroupEvent = MergeGroupChecksRequestedEvent;
202+
export type MergeGroupEvent =
203+
| MergeGroupChecksRequestedEvent
204+
| MergeGroupDestroyedEvent;
203205
export type MetaEvent = MetaDeletedEvent;
204206
export type WebhookEvents =
205207
| (
@@ -5161,6 +5163,52 @@ export interface MergeGroupChecksRequestedEvent {
51615163
installation?: InstallationLite;
51625164
organization?: Organization;
51635165
}
5166+
export interface MergeGroupDestroyedEvent {
5167+
action: "destroyed";
5168+
/**
5169+
* The merge group.
5170+
*/
5171+
merge_group: {
5172+
/**
5173+
* The SHA of the merge group.
5174+
*/
5175+
head_sha: string;
5176+
/**
5177+
* The full ref of the merge group.
5178+
*/
5179+
head_ref: string;
5180+
/**
5181+
* The full ref of the branch the merge group will be merged into.
5182+
*/
5183+
base_ref: string;
5184+
/**
5185+
* The SHA of the merge group's parent commit.
5186+
*/
5187+
base_sha: string;
5188+
/**
5189+
* An expanded representation of the `head_sha` commit.
5190+
*/
5191+
head_commit: {
5192+
id: string;
5193+
tree_id: string;
5194+
message: string;
5195+
timestamp: string;
5196+
author: {
5197+
name: string;
5198+
email: string;
5199+
};
5200+
committer: {
5201+
name: string;
5202+
email: string;
5203+
};
5204+
};
5205+
};
5206+
reason: "dequeued" | "invalidated" | "merged";
5207+
repository: Repository;
5208+
sender: User;
5209+
installation?: InstallationLite;
5210+
organization?: Organization;
5211+
}
51645212
export interface MetaDeletedEvent {
51655213
action: "deleted";
51665214
/**

0 commit comments

Comments
 (0)