From c8983a4e4cbdb8ccc5d14d49fcf4ff9510f4c8d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Brauer?= Date: Sun, 17 Sep 2023 00:42:53 +0200 Subject: [PATCH] fix: declare pull_request auto_merge properties as string|null (#829) * fix: declare pull_request auto_merge properties as string|null See: https://docs.github.com/en/webhooks-and-events/webhooks/webhook-events-and-payloads#pull_request Co-authored-by: wolfy1339 --- .../api.github.com/common/auto-merge.schema.json | 8 +++++--- payload-types/schema.d.ts | 6 +++--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/payload-schemas/api.github.com/common/auto-merge.schema.json b/payload-schemas/api.github.com/common/auto-merge.schema.json index 38efc37a0..fe4e35411 100644 --- a/payload-schemas/api.github.com/common/auto-merge.schema.json +++ b/payload-schemas/api.github.com/common/auto-merge.schema.json @@ -4,18 +4,20 @@ "type": "object", "required": ["enabled_by", "merge_method", "commit_title", "commit_message"], "properties": { - "enabled_by": { "$ref": "user.schema.json" }, + "enabled_by": { + "oneOf": [{ "$ref": "user.schema.json" }, { "type": "null" }] + }, "merge_method": { "type": "string", "enum": ["merge", "squash", "rebase"], "description": "The merge method to use." }, "commit_title": { - "type": "string", + "type": ["string", "null"], "description": "Title for the merge commit message." }, "commit_message": { - "type": "string", + "type": ["string", "null"], "description": "Commit message for the merge commit." } }, diff --git a/payload-types/schema.d.ts b/payload-types/schema.d.ts index 93dffe521..aba245f48 100644 --- a/payload-types/schema.d.ts +++ b/payload-types/schema.d.ts @@ -3008,7 +3008,7 @@ export interface Link { * The status of auto merging a pull request. */ export interface PullRequestAutoMerge { - enabled_by: User; + enabled_by: User | null; /** * The merge method to use. */ @@ -3016,11 +3016,11 @@ export interface PullRequestAutoMerge { /** * Title for the merge commit message. */ - commit_title: string; + commit_title: string | null; /** * Commit message for the merge commit. */ - commit_message: string; + commit_message: string | null; } export interface DeploymentReviewApprovedEvent { action: "approved";