From 7f4e2b1cba3fa8f3e18e76525a4747bb5cfa0bfc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yanick=20B=C3=A9langer?= Date: Thu, 3 Oct 2024 19:08:34 -0400 Subject: [PATCH 1/4] add destroyed event for merge group --- .../merge_group/destroyed.schema.json | 83 +++++++++++++++++++ 1 file changed, 83 insertions(+) create mode 100644 payload-schemas/api.github.com/merge_group/destroyed.schema.json diff --git a/payload-schemas/api.github.com/merge_group/destroyed.schema.json b/payload-schemas/api.github.com/merge_group/destroyed.schema.json new file mode 100644 index 000000000..09048cdd6 --- /dev/null +++ b/payload-schemas/api.github.com/merge_group/destroyed.schema.json @@ -0,0 +1,83 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "merge_group$destroyed", + "type": "object", + "required": ["action", "merge_group", "repository", "sender"], + "properties": { + "action": { "type": "string", "enum": ["destroyed"] }, + "merge_group": { + "type": "object", + "description": "The merge group.", + "required": [ + "head_sha", + "head_ref", + "base_ref", + "base_sha", + "head_commit" + ], + "properties": { + "head_sha": { + "type": "string", + "description": "The SHA of the merge group." + }, + "head_ref": { + "type": "string", + "description": "The full ref of the merge group." + }, + "base_ref": { + "type": "string", + "description": "The full ref of the branch the merge group will be merged into." + }, + "base_sha": { + "type": "string", + "description": "The SHA of the merge group's parent commit." + }, + "head_commit": { + "type": "object", + "description": "An expanded representation of the `head_sha` commit.", + "required": [ + "id", + "tree_id", + "message", + "timestamp", + "author", + "committer" + ], + "properties": { + "id": { "type": "string" }, + "tree_id": { "type": "string" }, + "message": { "type": "string" }, + "timestamp": { "type": "string", "format": "date-time" }, + "author": { + "type": "object", + "required": ["name", "email"], + "properties": { + "name": { "type": "string" }, + "email": { "type": "string" } + }, + "additionalProperties": false + }, + "committer": { + "type": "object", + "required": ["name", "email"], + "properties": { + "name": { "type": "string" }, + "email": { "type": "string" } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + "reason": { "type": "string", "enum": ["dequeued", "invalidated", "merged"] }, + "repository": { "$ref": "common/repository.schema.json" }, + "sender": { "$ref": "common/user.schema.json" }, + "installation": { "$ref": "common/installation-lite.schema.json" }, + "organization": { "$ref": "common/organization.schema.json" } + }, + "additionalProperties": false, + "title": "merge group destroyed event" + } \ No newline at end of file From 354023a0a95a911312caa87b8a24640bae364e94 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yanick=20B=C3=A9langer?= Date: Thu, 3 Oct 2024 19:10:48 -0400 Subject: [PATCH 2/4] make reason required --- .../api.github.com/merge_group/destroyed.schema.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/payload-schemas/api.github.com/merge_group/destroyed.schema.json b/payload-schemas/api.github.com/merge_group/destroyed.schema.json index 09048cdd6..12a64fb0d 100644 --- a/payload-schemas/api.github.com/merge_group/destroyed.schema.json +++ b/payload-schemas/api.github.com/merge_group/destroyed.schema.json @@ -2,7 +2,7 @@ "$schema": "http://json-schema.org/draft-07/schema#", "$id": "merge_group$destroyed", "type": "object", - "required": ["action", "merge_group", "repository", "sender"], + "required": ["action", "merge_group", "reason", "repository", "sender"], "properties": { "action": { "type": "string", "enum": ["destroyed"] }, "merge_group": { From d0365d3cd943573c01885be94d73514daef31fb0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yanick=20B=C3=A9langer?= Date: Thu, 3 Oct 2024 19:13:35 -0400 Subject: [PATCH 3/4] generate types --- payload-types/schema.d.ts | 50 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 49 insertions(+), 1 deletion(-) diff --git a/payload-types/schema.d.ts b/payload-types/schema.d.ts index b4b9fc5bd..0f7b47337 100644 --- a/payload-types/schema.d.ts +++ b/payload-types/schema.d.ts @@ -199,7 +199,9 @@ export type MemberEvent = | MemberEditedEvent | MemberRemovedEvent; export type MembershipEvent = MembershipAddedEvent | MembershipRemovedEvent; -export type MergeGroupEvent = MergeGroupChecksRequestedEvent; +export type MergeGroupEvent = + | MergeGroupChecksRequestedEvent + | MergeGroupDestroyedEvent; export type MetaEvent = MetaDeletedEvent; export type WebhookEvents = | ( @@ -5161,6 +5163,52 @@ export interface MergeGroupChecksRequestedEvent { installation?: InstallationLite; organization?: Organization; } +export interface MergeGroupDestroyedEvent { + action: "destroyed"; + /** + * The merge group. + */ + merge_group: { + /** + * The SHA of the merge group. + */ + head_sha: string; + /** + * The full ref of the merge group. + */ + head_ref: string; + /** + * The full ref of the branch the merge group will be merged into. + */ + base_ref: string; + /** + * The SHA of the merge group's parent commit. + */ + base_sha: string; + /** + * An expanded representation of the `head_sha` commit. + */ + head_commit: { + id: string; + tree_id: string; + message: string; + timestamp: string; + author: { + name: string; + email: string; + }; + committer: { + name: string; + email: string; + }; + }; + }; + reason: "dequeued" | "invalidated" | "merged"; + repository: Repository; + sender: User; + installation?: InstallationLite; + organization?: Organization; +} export interface MetaDeletedEvent { action: "deleted"; /** From 724e8f516b2c997783376ca50739b42b2f79dd09 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yanick=20B=C3=A9langer?= Date: Thu, 3 Oct 2024 19:20:08 -0400 Subject: [PATCH 4/4] run prettier --- .../merge_group/destroyed.schema.json | 159 +++++++++--------- 1 file changed, 81 insertions(+), 78 deletions(-) diff --git a/payload-schemas/api.github.com/merge_group/destroyed.schema.json b/payload-schemas/api.github.com/merge_group/destroyed.schema.json index 12a64fb0d..50cd81251 100644 --- a/payload-schemas/api.github.com/merge_group/destroyed.schema.json +++ b/payload-schemas/api.github.com/merge_group/destroyed.schema.json @@ -1,83 +1,86 @@ { - "$schema": "http://json-schema.org/draft-07/schema#", - "$id": "merge_group$destroyed", - "type": "object", - "required": ["action", "merge_group", "reason", "repository", "sender"], - "properties": { - "action": { "type": "string", "enum": ["destroyed"] }, - "merge_group": { - "type": "object", - "description": "The merge group.", - "required": [ - "head_sha", - "head_ref", - "base_ref", - "base_sha", - "head_commit" - ], - "properties": { - "head_sha": { - "type": "string", - "description": "The SHA of the merge group." - }, - "head_ref": { - "type": "string", - "description": "The full ref of the merge group." - }, - "base_ref": { - "type": "string", - "description": "The full ref of the branch the merge group will be merged into." - }, - "base_sha": { - "type": "string", - "description": "The SHA of the merge group's parent commit." - }, - "head_commit": { - "type": "object", - "description": "An expanded representation of the `head_sha` commit.", - "required": [ - "id", - "tree_id", - "message", - "timestamp", - "author", - "committer" - ], - "properties": { - "id": { "type": "string" }, - "tree_id": { "type": "string" }, - "message": { "type": "string" }, - "timestamp": { "type": "string", "format": "date-time" }, - "author": { - "type": "object", - "required": ["name", "email"], - "properties": { - "name": { "type": "string" }, - "email": { "type": "string" } - }, - "additionalProperties": false + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "merge_group$destroyed", + "type": "object", + "required": ["action", "merge_group", "reason", "repository", "sender"], + "properties": { + "action": { "type": "string", "enum": ["destroyed"] }, + "merge_group": { + "type": "object", + "description": "The merge group.", + "required": [ + "head_sha", + "head_ref", + "base_ref", + "base_sha", + "head_commit" + ], + "properties": { + "head_sha": { + "type": "string", + "description": "The SHA of the merge group." + }, + "head_ref": { + "type": "string", + "description": "The full ref of the merge group." + }, + "base_ref": { + "type": "string", + "description": "The full ref of the branch the merge group will be merged into." + }, + "base_sha": { + "type": "string", + "description": "The SHA of the merge group's parent commit." + }, + "head_commit": { + "type": "object", + "description": "An expanded representation of the `head_sha` commit.", + "required": [ + "id", + "tree_id", + "message", + "timestamp", + "author", + "committer" + ], + "properties": { + "id": { "type": "string" }, + "tree_id": { "type": "string" }, + "message": { "type": "string" }, + "timestamp": { "type": "string", "format": "date-time" }, + "author": { + "type": "object", + "required": ["name", "email"], + "properties": { + "name": { "type": "string" }, + "email": { "type": "string" } }, - "committer": { - "type": "object", - "required": ["name", "email"], - "properties": { - "name": { "type": "string" }, - "email": { "type": "string" } - }, - "additionalProperties": false - } + "additionalProperties": false }, - "additionalProperties": false - } - }, - "additionalProperties": false + "committer": { + "type": "object", + "required": ["name", "email"], + "properties": { + "name": { "type": "string" }, + "email": { "type": "string" } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + } }, - "reason": { "type": "string", "enum": ["dequeued", "invalidated", "merged"] }, - "repository": { "$ref": "common/repository.schema.json" }, - "sender": { "$ref": "common/user.schema.json" }, - "installation": { "$ref": "common/installation-lite.schema.json" }, - "organization": { "$ref": "common/organization.schema.json" } + "additionalProperties": false + }, + "reason": { + "type": "string", + "enum": ["dequeued", "invalidated", "merged"] }, - "additionalProperties": false, - "title": "merge group destroyed event" - } \ No newline at end of file + "repository": { "$ref": "common/repository.schema.json" }, + "sender": { "$ref": "common/user.schema.json" }, + "installation": { "$ref": "common/installation-lite.schema.json" }, + "organization": { "$ref": "common/organization.schema.json" } + }, + "additionalProperties": false, + "title": "merge group destroyed event" +}