From 12c2a16fd087427cabc8f8638518f9620a7a7e5b Mon Sep 17 00:00:00 2001 From: wolfy1339 <4595477+wolfy1339@users.noreply.github.com> Date: Wed, 22 Dec 2021 15:28:16 -0500 Subject: [PATCH] feat: new `changes.base` property on `pull_request#edited`, new `merged_at` property on issues common schema, new `rerequestable` property on `check_suite#completed`, new `log_url` property on `deployment#created` (#598) * fix: `draft` property on `issues` is not always present * fix: remove `merge_commit_sha` override in `pull_request#reopened` * fix: `runner_{id, name, group_id, group_name}` can also be `null` on `workflow_job#queued` * feat: new `base` property in `changes` for `pull_request#edited` * feat: new `merged_at` property on issue common schema * feat: new `rerequestable` property for `check_suite#completed` * feat: new `log_url` property for `deployment#created` * fix: `Deployment#payload` can have additional properties --- .../check_suite/completed.schema.json | 1 + .../api.github.com/common/issue.schema.json | 6 ++--- .../deployment/created.schema.json | 2 +- .../deployment_status/created.schema.json | 1 + .../pull_request/edited.schema.json | 19 ++++++++++++++ .../pull_request/reopened.schema.json | 2 -- .../workflow_job/queued.schema.json | 8 +++--- payload-types/schema.d.ts | 26 ++++++++++++++----- 8 files changed, 48 insertions(+), 17 deletions(-) diff --git a/payload-schemas/api.github.com/check_suite/completed.schema.json b/payload-schemas/api.github.com/check_suite/completed.schema.json index 1adc3eee0..a2f680326 100644 --- a/payload-schemas/api.github.com/check_suite/completed.schema.json +++ b/payload-schemas/api.github.com/check_suite/completed.schema.json @@ -71,6 +71,7 @@ "app": { "$ref": "common/app.schema.json" }, "created_at": { "type": "string", "format": "date-time" }, "updated_at": { "type": "string", "format": "date-time" }, + "rerequestable": { "type": "boolean" }, "latest_check_runs_count": { "type": "integer" }, "check_runs_url": { "type": "string", "format": "uri" }, "head_commit": { "$ref": "common/commit-simple.schema.json" } diff --git a/payload-schemas/api.github.com/common/issue.schema.json b/payload-schemas/api.github.com/common/issue.schema.json index 069265222..22ddcecb8 100644 --- a/payload-schemas/api.github.com/common/issue.schema.json +++ b/payload-schemas/api.github.com/common/issue.schema.json @@ -23,8 +23,7 @@ "author_association", "active_lock_reason", "body", - "reactions", - "draft" + "reactions" ], "type": "object", "properties": { @@ -76,7 +75,8 @@ "url": { "type": "string", "format": "uri" }, "html_url": { "type": "string", "format": "uri" }, "diff_url": { "type": "string", "format": "uri" }, - "patch_url": { "type": "string", "format": "uri" } + "patch_url": { "type": "string", "format": "uri" }, + "merged_at": { "type": ["string", "null"], "format": "date-time" } }, "additionalProperties": false }, diff --git a/payload-schemas/api.github.com/deployment/created.schema.json b/payload-schemas/api.github.com/deployment/created.schema.json index 39a526d64..23fc9fe7a 100644 --- a/payload-schemas/api.github.com/deployment/created.schema.json +++ b/payload-schemas/api.github.com/deployment/created.schema.json @@ -42,7 +42,7 @@ "payload": { "type": "object", "required": [], - "additionalProperties": false + "additionalProperties": true }, "original_environment": { "type": "string" }, "environment": { "type": "string" }, diff --git a/payload-schemas/api.github.com/deployment_status/created.schema.json b/payload-schemas/api.github.com/deployment_status/created.schema.json index 7f5f86156..b7a865f19 100644 --- a/payload-schemas/api.github.com/deployment_status/created.schema.json +++ b/payload-schemas/api.github.com/deployment_status/created.schema.json @@ -43,6 +43,7 @@ }, "environment": { "type": "string" }, "environment_url": { "type": "string", "format": "uri" }, + "log_url": { "type": "string", "format": "uri" }, "target_url": { "type": "string", "description": "The optional link added to the status." diff --git a/payload-schemas/api.github.com/pull_request/edited.schema.json b/payload-schemas/api.github.com/pull_request/edited.schema.json index fd5cb928f..846cf4771 100644 --- a/payload-schemas/api.github.com/pull_request/edited.schema.json +++ b/payload-schemas/api.github.com/pull_request/edited.schema.json @@ -38,6 +38,25 @@ } }, "additionalProperties": false + }, + "base": { + "type": "object", + "required": ["ref", "sha"], + "properties": { + "ref": { + "type": "object", + "required": ["from"], + "properties": { "from": { "type": "string" } }, + "additionalProperties": false + }, + "sha": { + "type": "object", + "required": ["from"], + "properties": { "from": { "type": "string" } }, + "additionalProperties": false + } + }, + "additionalProperties": false } }, "additionalProperties": false diff --git a/payload-schemas/api.github.com/pull_request/reopened.schema.json b/payload-schemas/api.github.com/pull_request/reopened.schema.json index 5534af2a6..5f5732936 100644 --- a/payload-schemas/api.github.com/pull_request/reopened.schema.json +++ b/payload-schemas/api.github.com/pull_request/reopened.schema.json @@ -15,7 +15,6 @@ "state", "closed_at", "merged_at", - "merge_commit_sha", "merged", "merged_by" ], @@ -23,7 +22,6 @@ "state": { "type": "string", "enum": ["open"] }, "closed_at": { "type": "null" }, "merged_at": { "type": "null" }, - "merge_commit_sha": { "type": "null" }, "merged": { "type": "boolean" }, "merged_by": { "type": "null" } }, diff --git a/payload-schemas/api.github.com/workflow_job/queued.schema.json b/payload-schemas/api.github.com/workflow_job/queued.schema.json index 47b5ace9e..99682361e 100644 --- a/payload-schemas/api.github.com/workflow_job/queued.schema.json +++ b/payload-schemas/api.github.com/workflow_job/queued.schema.json @@ -51,10 +51,10 @@ }, "conclusion": { "type": "null" }, "labels": { "type": "array", "items": { "type": "string" } }, - "runner_id": { "type": "integer" }, - "runner_name": { "type": "string" }, - "runner_group_id": { "type": "integer" }, - "runner_group_name": { "type": "string" }, + "runner_id": { "type": ["integer", "null"] }, + "runner_name": { "type": ["string", "null"] }, + "runner_group_id": { "type": ["integer", "null"] }, + "runner_group_name": { "type": ["string", "null"] }, "started_at": { "type": "string", "format": "date-time" }, "completed_at": { "type": "null" } }, diff --git a/payload-types/schema.d.ts b/payload-types/schema.d.ts index d05e0e638..6471c2e38 100644 --- a/payload-types/schema.d.ts +++ b/payload-types/schema.d.ts @@ -1276,6 +1276,7 @@ export interface CheckSuiteCompletedEvent { app: App; created_at: string; updated_at: string; + rerequestable?: boolean; latest_check_runs_count: number; check_runs_url: string; head_commit: SimpleCommit; @@ -2095,7 +2096,9 @@ export interface DeploymentCreatedEvent { sha: string; ref: string; task: string; - payload: {}; + payload: { + [k: string]: unknown; + }; original_environment: string; environment: string; transient_environment?: boolean; @@ -2135,6 +2138,7 @@ export interface DeploymentStatusCreatedEvent { description: string; environment: string; environment_url?: string; + log_url?: string; /** * The optional link added to the status. */ @@ -2925,13 +2929,14 @@ export interface Issue { closed_at: string | null; author_association: AuthorAssociation; active_lock_reason: "resolved" | "off-topic" | "too heated" | "spam" | null; - draft: boolean; + draft?: boolean; performed_via_github_app?: App | null; pull_request?: { url?: string; html_url?: string; diff_url?: string; patch_url?: string; + merged_at?: string | null; }; /** * Contents of the issue @@ -4401,6 +4406,14 @@ export interface PullRequestEditedEvent { */ from: string; }; + base?: { + ref: { + from: string; + }; + sha: { + from: string; + }; + }; }; pull_request: PullRequest; repository: Repository; @@ -4484,7 +4497,6 @@ export interface PullRequestReopenedEvent { state: "open"; closed_at: null; merged_at: null; - merge_commit_sha: null; merged: boolean; merged_by: null; }; @@ -6108,10 +6120,10 @@ export interface WorkflowJobQueuedEvent { steps: WorkflowStep[]; conclusion: null; labels: string[]; - runner_id: number; - runner_name: string; - runner_group_id: number; - runner_group_name: string; + runner_id: number | null; + runner_name: string | null; + runner_group_id: number | null; + runner_group_name: string | null; started_at: string; completed_at: null; };