Skip to content

Commit

Permalink
feat(schemas): added schema for the merge_group destroyed event (#962)
Browse files Browse the repository at this point in the history
  • Loading branch information
emeraldsanto authored Oct 3, 2024
1 parent 927e57f commit 524ed0d
Show file tree
Hide file tree
Showing 2 changed files with 135 additions and 1 deletion.
86 changes: 86 additions & 0 deletions payload-schemas/api.github.com/merge_group/destroyed.schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +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
},
"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"
}
50 changes: 49 additions & 1 deletion payload-types/schema.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
| (
Expand Down Expand Up @@ -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";
/**
Expand Down

0 comments on commit 524ed0d

Please sign in to comment.