From 44b5c3c6aa56bb780b01f0af972942496c08a783 Mon Sep 17 00:00:00 2001 From: Octokit Bot Date: Sun, 2 Oct 2022 19:08:30 -0700 Subject: [PATCH] feat: new `pull_request.dequeued` and `pull_request.queued` events (#715) Co-authored-by: wolfy1339 --- .../webhook-events-and-payloads.html | 22 ++++++++++++++ payload-examples/api.github.com/index.json | 6 ++++ .../pull_request/dequeued.schema.json | 28 +++++++++++++++++ .../pull_request/queued.schema.json | 17 +++++++++++ payload-types/schema.d.ts | 30 +++++++++++++++++++ 5 files changed, 103 insertions(+) create mode 100644 payload-schemas/api.github.com/pull_request/dequeued.schema.json create mode 100644 payload-schemas/api.github.com/pull_request/queued.schema.json diff --git a/cache/api.github.com/webhook-events-and-payloads.html b/cache/api.github.com/webhook-events-and-payloads.html index 3d90535dc..346e76899 100644 --- a/cache/api.github.com/webhook-events-and-payloads.html +++ b/cache/api.github.com/webhook-events-and-payloads.html @@ -12561,6 +12561,12 @@

>pull requests" REST API.

+
+

+ Note: The pull request merge queue feature is + currently in limited public beta and subject to change. +

+

true, the pull request was merged.
  • converted_to_draft
  • +
  • + dequeued: Triggered when a pull request is + removed from a merge queue +
  • edited
  • +
  • + enqueued: Triggered when a pull request is added + to a merge queue +
  • labeled
  • locked
  • opened
  • @@ -12690,6 +12704,14 @@

    The pull request itself. + + reason + string + + The reason the pull request was removed from a merge queue if the + action was dequeued. + + repository object diff --git a/payload-examples/api.github.com/index.json b/payload-examples/api.github.com/index.json index a494b77ce..653729cfa 100644 --- a/payload-examples/api.github.com/index.json +++ b/payload-examples/api.github.com/index.json @@ -36405,7 +36405,9 @@ "auto_merge_enabled", "closed", "converted_to_draft", + "dequeued", "edited", + "enqueued", "labeled", "locked", "merged", @@ -36440,6 +36442,10 @@ "type": "object", "description": "The [pull request](https://docs.github.com/en/rest/reference/pulls) itself." }, + "reason": { + "type": "string", + "description": "The reason the pull request was removed from a merge queue if the action was `dequeued`." + }, "repository": { "type": "object", "description": "The [`repository`](https://docs.github.com/en/rest/reference/repos#get-a-repository) where the event occurred." diff --git a/payload-schemas/api.github.com/pull_request/dequeued.schema.json b/payload-schemas/api.github.com/pull_request/dequeued.schema.json new file mode 100644 index 000000000..61aba8e24 --- /dev/null +++ b/payload-schemas/api.github.com/pull_request/dequeued.schema.json @@ -0,0 +1,28 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema", + "$id": "pull_request$dequeued", + "type": "object", + "required": [ + "action", + "number", + "reason", + "pull_request", + "repository", + "sender" + ], + "properties": { + "action": { "type": "string", "enum": ["dequeued"] }, + "number": { "type": "integer", "description": "The pull request number." }, + "reason": { + "type": "string", + "description": "The reason the pull request was removed from a merge queue." + }, + "pull_request": { "$ref": "common/pull-request.schema.json" }, + "repository": { "$ref": "common/repository.schema.json" }, + "installation": { "$ref": "common/installation-lite.schema.json" }, + "organization": { "$ref": "common/organization.schema.json" }, + "sender": { "$ref": "common/user.schema.json" } + }, + "additionalProperties": false, + "title": "pull_request dequeued event" +} diff --git a/payload-schemas/api.github.com/pull_request/queued.schema.json b/payload-schemas/api.github.com/pull_request/queued.schema.json new file mode 100644 index 000000000..c5d6c4634 --- /dev/null +++ b/payload-schemas/api.github.com/pull_request/queued.schema.json @@ -0,0 +1,17 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema", + "$id": "pull_request$queued", + "type": "object", + "required": ["action", "number", "pull_request", "repository", "sender"], + "properties": { + "action": { "type": "string", "enum": ["queued"] }, + "number": { "type": "integer", "description": "The pull request number." }, + "pull_request": { "$ref": "common/pull-request.schema.json" }, + "repository": { "$ref": "common/repository.schema.json" }, + "installation": { "$ref": "common/installation-lite.schema.json" }, + "organization": { "$ref": "common/organization.schema.json" }, + "sender": { "$ref": "common/user.schema.json" } + }, + "additionalProperties": false, + "title": "pull_request queued event" +} diff --git a/payload-types/schema.d.ts b/payload-types/schema.d.ts index 8aa716735..5b10b343b 100644 --- a/payload-types/schema.d.ts +++ b/payload-types/schema.d.ts @@ -271,10 +271,12 @@ export type PullRequestEvent = | PullRequestAutoMergeEnabledEvent | PullRequestClosedEvent | PullRequestConvertedToDraftEvent + | PullRequestDequeuedEvent | PullRequestEditedEvent | PullRequestLabeledEvent | PullRequestLockedEvent | PullRequestOpenedEvent + | PullRequestQueuedEvent | PullRequestReadyForReviewEvent | PullRequestReopenedEvent | PullRequestReviewRequestRemovedEvent @@ -5040,6 +5042,22 @@ export interface PullRequestConvertedToDraftEvent { organization?: Organization; sender: User; } +export interface PullRequestDequeuedEvent { + action: "dequeued"; + /** + * The pull request number. + */ + number: number; + /** + * The reason the pull request was removed from a merge queue. + */ + reason: string; + pull_request: PullRequest; + repository: Repository; + installation?: InstallationLite; + organization?: Organization; + sender: User; +} export interface PullRequestEditedEvent { action: "edited"; /** @@ -5120,6 +5138,18 @@ export interface PullRequestOpenedEvent { organization?: Organization; sender: User; } +export interface PullRequestQueuedEvent { + action: "queued"; + /** + * The pull request number. + */ + number: number; + pull_request: PullRequest; + repository: Repository; + installation?: InstallationLite; + organization?: Organization; + sender: User; +} export interface PullRequestReadyForReviewEvent { action: "ready_for_review"; /**