diff --git a/payload-schemas/schemas/check_run/completed.schema.json b/payload-schemas/schemas/check_run/completed.schema.json index f3073544f..6c82a1dd1 100644 --- a/payload-schemas/schemas/check_run/completed.schema.json +++ b/payload-schemas/schemas/check_run/completed.schema.json @@ -125,36 +125,7 @@ "after": { "type": ["string", "null"] }, "pull_requests": { "type": "array", - "items": { - "type": "object", - "required": ["url", "id", "number", "head", "base"], - "properties": { - "url": { "type": "string", "format": "uri" }, - "id": { "type": "integer" }, - "number": { "type": "integer" }, - "head": { - "type": "object", - "required": ["ref", "sha", "repo"], - "properties": { - "ref": { "type": "string" }, - "sha": { "type": "string" }, - "repo": { "$ref": "common/repo-ref.schema.json" } - }, - "additionalProperties": false - }, - "base": { - "type": "object", - "required": ["ref", "sha", "repo"], - "properties": { - "ref": { "type": "string" }, - "sha": { "type": "string" }, - "repo": { "$ref": "common/repo-ref.schema.json" } - }, - "additionalProperties": false - } - }, - "additionalProperties": false - } + "items": { "$ref": "common/check-run-pull-request.schema.json" } }, "app": { "$ref": "common/app.schema.json" }, "created_at": { "type": "string", "format": "date-time" }, @@ -165,36 +136,7 @@ "app": { "$ref": "common/app.schema.json" }, "pull_requests": { "type": "array", - "items": { - "type": "object", - "required": ["url", "id", "number", "head", "base"], - "properties": { - "url": { "type": "string", "format": "uri" }, - "id": { "type": "integer" }, - "number": { "type": "integer" }, - "head": { - "type": "object", - "required": ["ref", "sha", "repo"], - "properties": { - "ref": { "type": "string" }, - "sha": { "type": "string" }, - "repo": { "$ref": "common/repo-ref.schema.json" } - }, - "additionalProperties": false - }, - "base": { - "type": "object", - "required": ["ref", "sha", "repo"], - "properties": { - "ref": { "type": "string" }, - "sha": { "type": "string" }, - "repo": { "$ref": "common/repo-ref.schema.json" } - }, - "additionalProperties": false - } - }, - "additionalProperties": false - } + "items": { "$ref": "common/check-run-pull-request.schema.json" } }, "deployment": { "$ref": "common/check-run-deployment.schema.json" } }, diff --git a/payload-schemas/schemas/check_run/created.schema.json b/payload-schemas/schemas/check_run/created.schema.json index 63578f74c..439f88c42 100644 --- a/payload-schemas/schemas/check_run/created.schema.json +++ b/payload-schemas/schemas/check_run/created.schema.json @@ -110,36 +110,7 @@ "after": { "type": ["string", "null"] }, "pull_requests": { "type": "array", - "items": { - "type": "object", - "required": ["url", "id", "number", "head", "base"], - "properties": { - "url": { "type": "string", "format": "uri" }, - "id": { "type": "integer" }, - "number": { "type": "integer" }, - "head": { - "type": "object", - "required": ["ref", "sha", "repo"], - "properties": { - "ref": { "type": "string" }, - "sha": { "type": "string" }, - "repo": { "$ref": "common/repo-ref.schema.json" } - }, - "additionalProperties": false - }, - "base": { - "type": "object", - "required": ["ref", "sha", "repo"], - "properties": { - "ref": { "type": "string" }, - "sha": { "type": "string" }, - "repo": { "$ref": "common/repo-ref.schema.json" } - }, - "additionalProperties": false - } - }, - "additionalProperties": false - } + "items": { "$ref": "common/check-run-pull-request.schema.json" } }, "app": { "$ref": "common/app.schema.json" }, "created_at": { "type": "string", "format": "date-time" }, @@ -150,36 +121,7 @@ "app": { "$ref": "common/app.schema.json" }, "pull_requests": { "type": "array", - "items": { - "type": "object", - "required": ["url", "id", "number", "head", "base"], - "properties": { - "url": { "type": "string", "format": "uri" }, - "id": { "type": "integer" }, - "number": { "type": "integer" }, - "head": { - "type": "object", - "required": ["ref", "sha", "repo"], - "properties": { - "ref": { "type": "string" }, - "sha": { "type": "string" }, - "repo": { "$ref": "common/repo-ref.schema.json" } - }, - "additionalProperties": false - }, - "base": { - "type": "object", - "required": ["ref", "sha", "repo"], - "properties": { - "ref": { "type": "string" }, - "sha": { "type": "string" }, - "repo": { "$ref": "common/repo-ref.schema.json" } - }, - "additionalProperties": false - } - }, - "additionalProperties": false - } + "items": { "$ref": "common/check-run-pull-request.schema.json" } }, "deployment": { "$ref": "common/check-run-deployment.schema.json" } }, diff --git a/payload-schemas/schemas/check_run/requested_action.schema.json b/payload-schemas/schemas/check_run/requested_action.schema.json index 932c06e94..a565f83c8 100644 --- a/payload-schemas/schemas/check_run/requested_action.schema.json +++ b/payload-schemas/schemas/check_run/requested_action.schema.json @@ -125,36 +125,7 @@ "after": { "type": ["string", "null"] }, "pull_requests": { "type": "array", - "items": { - "type": "object", - "required": ["url", "id", "number", "head", "base"], - "properties": { - "url": { "type": "string", "format": "uri" }, - "id": { "type": "integer" }, - "number": { "type": "integer" }, - "head": { - "type": "object", - "required": ["ref", "sha", "repo"], - "properties": { - "ref": { "type": "string" }, - "sha": { "type": "string" }, - "repo": { "$ref": "common/repo-ref.schema.json" } - }, - "additionalProperties": false - }, - "base": { - "type": "object", - "required": ["ref", "sha", "repo"], - "properties": { - "ref": { "type": "string" }, - "sha": { "type": "string" }, - "repo": { "$ref": "common/repo-ref.schema.json" } - }, - "additionalProperties": false - } - }, - "additionalProperties": false - } + "items": { "$ref": "common/check-run-pull-request.schema.json" } }, "app": { "$ref": "common/app.schema.json" }, "created_at": { "type": "string", "format": "date-time" }, @@ -165,36 +136,7 @@ "app": { "$ref": "common/app.schema.json" }, "pull_requests": { "type": "array", - "items": { - "type": "object", - "required": ["url", "id", "number", "head", "base"], - "properties": { - "url": { "type": "string", "format": "uri" }, - "id": { "type": "integer" }, - "number": { "type": "integer" }, - "head": { - "type": "object", - "required": ["ref", "sha", "repo"], - "properties": { - "ref": { "type": "string" }, - "sha": { "type": "string" }, - "repo": { "$ref": "common/repo-ref.schema.json" } - }, - "additionalProperties": false - }, - "base": { - "type": "object", - "required": ["ref", "sha", "repo"], - "properties": { - "ref": { "type": "string" }, - "sha": { "type": "string" }, - "repo": { "$ref": "common/repo-ref.schema.json" } - }, - "additionalProperties": false - } - }, - "additionalProperties": false - } + "items": { "$ref": "common/check-run-pull-request.schema.json" } }, "deployment": { "$ref": "common/check-run-deployment.schema.json" } }, diff --git a/payload-schemas/schemas/check_run/rerequested.schema.json b/payload-schemas/schemas/check_run/rerequested.schema.json index 9ec48a6ff..ff231efb1 100644 --- a/payload-schemas/schemas/check_run/rerequested.schema.json +++ b/payload-schemas/schemas/check_run/rerequested.schema.json @@ -121,36 +121,7 @@ "after": { "type": ["string", "null"] }, "pull_requests": { "type": "array", - "items": { - "type": "object", - "required": ["url", "id", "number", "head", "base"], - "properties": { - "url": { "type": "string", "format": "uri" }, - "id": { "type": "integer" }, - "number": { "type": "integer" }, - "head": { - "type": "object", - "required": ["ref", "sha", "repo"], - "properties": { - "ref": { "type": "string" }, - "sha": { "type": "string" }, - "repo": { "$ref": "common/repo-ref.schema.json" } - }, - "additionalProperties": false - }, - "base": { - "type": "object", - "required": ["ref", "sha", "repo"], - "properties": { - "ref": { "type": "string" }, - "sha": { "type": "string" }, - "repo": { "$ref": "common/repo-ref.schema.json" } - }, - "additionalProperties": false - } - }, - "additionalProperties": false - } + "items": { "$ref": "common/check-run-pull-request.schema.json" } }, "app": { "$ref": "common/app.schema.json" }, "created_at": { "type": "string", "format": "date-time" }, @@ -161,36 +132,7 @@ "app": { "$ref": "common/app.schema.json" }, "pull_requests": { "type": "array", - "items": { - "type": "object", - "required": ["url", "id", "number", "head", "base"], - "properties": { - "url": { "type": "string", "format": "uri" }, - "id": { "type": "integer" }, - "number": { "type": "integer" }, - "head": { - "type": "object", - "required": ["ref", "sha", "repo"], - "properties": { - "ref": { "type": "string" }, - "sha": { "type": "string" }, - "repo": { "$ref": "common/repo-ref.schema.json" } - }, - "additionalProperties": false - }, - "base": { - "type": "object", - "required": ["ref", "sha", "repo"], - "properties": { - "ref": { "type": "string" }, - "sha": { "type": "string" }, - "repo": { "$ref": "common/repo-ref.schema.json" } - }, - "additionalProperties": false - } - }, - "additionalProperties": false - } + "items": { "$ref": "common/check-run-pull-request.schema.json" } }, "deployment": { "$ref": "common/check-run-deployment.schema.json" } }, diff --git a/payload-schemas/schemas/check_suite/completed.schema.json b/payload-schemas/schemas/check_suite/completed.schema.json index 7b2843b7d..478d7bb1b 100644 --- a/payload-schemas/schemas/check_suite/completed.schema.json +++ b/payload-schemas/schemas/check_suite/completed.schema.json @@ -55,36 +55,7 @@ "after": { "type": "string" }, "pull_requests": { "type": "array", - "items": { - "type": "object", - "required": ["url", "id", "number", "head", "base"], - "properties": { - "url": { "type": "string", "format": "uri" }, - "id": { "type": "integer" }, - "number": { "type": "integer" }, - "head": { - "type": "object", - "required": ["ref", "sha", "repo"], - "properties": { - "ref": { "type": "string" }, - "sha": { "type": "string" }, - "repo": { "$ref": "common/repo-ref.schema.json" } - }, - "additionalProperties": false - }, - "base": { - "type": "object", - "required": ["ref", "sha", "repo"], - "properties": { - "ref": { "type": "string" }, - "sha": { "type": "string" }, - "repo": { "$ref": "common/repo-ref.schema.json" } - }, - "additionalProperties": false - } - }, - "additionalProperties": false - } + "items": { "$ref": "common/check-run-pull-request.schema.json" } }, "app": { "$ref": "common/app.schema.json" }, "created_at": { "type": "string", "format": "date-time" }, diff --git a/payload-schemas/schemas/check_suite/requested.schema.json b/payload-schemas/schemas/check_suite/requested.schema.json index 550fcb39a..22fd95f98 100644 --- a/payload-schemas/schemas/check_suite/requested.schema.json +++ b/payload-schemas/schemas/check_suite/requested.schema.json @@ -55,36 +55,7 @@ "after": { "type": "string" }, "pull_requests": { "type": "array", - "items": { - "type": "object", - "required": ["url", "id", "number", "head", "base"], - "properties": { - "url": { "type": "string", "format": "uri" }, - "id": { "type": "integer" }, - "number": { "type": "integer" }, - "head": { - "type": "object", - "required": ["ref", "sha", "repo"], - "properties": { - "ref": { "type": "string" }, - "sha": { "type": "string" }, - "repo": { "$ref": "common/repo-ref.schema.json" } - }, - "additionalProperties": false - }, - "base": { - "type": "object", - "required": ["ref", "sha", "repo"], - "properties": { - "ref": { "type": "string" }, - "sha": { "type": "string" }, - "repo": { "$ref": "common/repo-ref.schema.json" } - }, - "additionalProperties": false - } - }, - "additionalProperties": false - } + "items": { "$ref": "common/check-run-pull-request.schema.json" } }, "app": { "$ref": "common/app.schema.json" }, "created_at": { "type": "string", "format": "date-time" }, diff --git a/payload-schemas/schemas/check_suite/rerequested.schema.json b/payload-schemas/schemas/check_suite/rerequested.schema.json index 827e61d0a..b19cd1a6c 100644 --- a/payload-schemas/schemas/check_suite/rerequested.schema.json +++ b/payload-schemas/schemas/check_suite/rerequested.schema.json @@ -55,36 +55,7 @@ "after": { "type": "string" }, "pull_requests": { "type": "array", - "items": { - "type": "object", - "required": ["url", "id", "number", "head", "base"], - "properties": { - "url": { "type": "string", "format": "uri" }, - "id": { "type": "integer" }, - "number": { "type": "integer" }, - "head": { - "type": "object", - "required": ["ref", "sha", "repo"], - "properties": { - "ref": { "type": "string" }, - "sha": { "type": "string" }, - "repo": { "$ref": "common/repo-ref.schema.json" } - }, - "additionalProperties": false - }, - "base": { - "type": "object", - "required": ["ref", "sha", "repo"], - "properties": { - "ref": { "type": "string" }, - "sha": { "type": "string" }, - "repo": { "$ref": "common/repo-ref.schema.json" } - }, - "additionalProperties": false - } - }, - "additionalProperties": false - } + "items": { "$ref": "common/check-run-pull-request.schema.json" } }, "app": { "$ref": "common/app.schema.json" }, "created_at": { "type": "string", "format": "date-time" }, diff --git a/payload-schemas/schemas/common/check-run-pull-request.schema.json b/payload-schemas/schemas/common/check-run-pull-request.schema.json new file mode 100644 index 000000000..e6c80d9ec --- /dev/null +++ b/payload-schemas/schemas/common/check-run-pull-request.schema.json @@ -0,0 +1,33 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema", + "$id": "common/check-run-pull-request.schema.json", + "type": "object", + "required": ["url", "id", "number", "head", "base"], + "properties": { + "url": { "type": "string", "format": "uri" }, + "id": { "type": "integer" }, + "number": { "type": "integer" }, + "head": { + "type": "object", + "required": ["ref", "sha", "repo"], + "properties": { + "ref": { "type": "string" }, + "sha": { "type": "string" }, + "repo": { "$ref": "repo-ref.schema.json" } + }, + "additionalProperties": false + }, + "base": { + "type": "object", + "required": ["ref", "sha", "repo"], + "properties": { + "ref": { "type": "string" }, + "sha": { "type": "string" }, + "repo": { "$ref": "repo-ref.schema.json" } + }, + "additionalProperties": false + } + }, + "additionalProperties": false, + "title": "Check Run Pull Request" +} diff --git a/schema.d.ts b/schema.d.ts index 335440f24..ca77d9235 100644 --- a/schema.d.ts +++ b/schema.d.ts @@ -316,41 +316,13 @@ export interface CheckRunCompletedEvent { url: string; before: string | null; after: string | null; - pull_requests: { - url: string; - id: number; - number: number; - head: { - ref: string; - sha: string; - repo: RepoRef; - }; - base: { - ref: string; - sha: string; - repo: RepoRef; - }; - }[]; + pull_requests: CheckRunPullRequest[]; app: App; created_at: string; updated_at: string; }; app: App; - pull_requests: { - url: string; - id: number; - number: number; - head: { - ref: string; - sha: string; - repo: RepoRef; - }; - base: { - ref: string; - sha: string; - repo: RepoRef; - }; - }[]; + pull_requests: CheckRunPullRequest[]; deployment?: CheckRunDeployment; }; requested_action?: { @@ -361,6 +333,21 @@ export interface CheckRunCompletedEvent { installation?: InstallationLite; organization?: Organization; } +export interface CheckRunPullRequest { + url: string; + id: number; + number: number; + head: { + ref: string; + sha: string; + repo: RepoRef; + }; + base: { + ref: string; + sha: string; + repo: RepoRef; + }; +} export interface RepoRef { id: number; url: string; @@ -691,41 +678,13 @@ export interface CheckRunCreatedEvent { url: string; before: string | null; after: string | null; - pull_requests: { - url: string; - id: number; - number: number; - head: { - ref: string; - sha: string; - repo: RepoRef; - }; - base: { - ref: string; - sha: string; - repo: RepoRef; - }; - }[]; + pull_requests: CheckRunPullRequest[]; app: App; created_at: string; updated_at: string; }; app: App; - pull_requests: { - url: string; - id: number; - number: number; - head: { - ref: string; - sha: string; - repo: RepoRef; - }; - base: { - ref: string; - sha: string; - repo: RepoRef; - }; - }[]; + pull_requests: CheckRunPullRequest[]; deployment?: CheckRunDeployment; }; requested_action?: { @@ -808,41 +767,13 @@ export interface CheckRunRequestedActionEvent { url: string; before: string | null; after: string | null; - pull_requests: { - url: string; - id: number; - number: number; - head: { - ref: string; - sha: string; - repo: RepoRef; - }; - base: { - ref: string; - sha: string; - repo: RepoRef; - }; - }[]; + pull_requests: CheckRunPullRequest[]; app: App; created_at: string; updated_at: string; }; app: App; - pull_requests: { - url: string; - id: number; - number: number; - head: { - ref: string; - sha: string; - repo: RepoRef; - }; - base: { - ref: string; - sha: string; - repo: RepoRef; - }; - }[]; + pull_requests: CheckRunPullRequest[]; deployment?: CheckRunDeployment; }; requested_action?: { @@ -924,41 +855,13 @@ export interface CheckRunRerequestedEvent { url: string; before: string | null; after: string | null; - pull_requests: { - url: string; - id: number; - number: number; - head: { - ref: string; - sha: string; - repo: RepoRef; - }; - base: { - ref: string; - sha: string; - repo: RepoRef; - }; - }[]; + pull_requests: CheckRunPullRequest[]; app: App; created_at: string; updated_at: string; }; app: App; - pull_requests: { - url: string; - id: number; - number: number; - head: { - ref: string; - sha: string; - repo: RepoRef; - }; - base: { - ref: string; - sha: string; - repo: RepoRef; - }; - }[]; + pull_requests: CheckRunPullRequest[]; deployment?: CheckRunDeployment; }; requested_action?: { @@ -992,21 +895,7 @@ export interface CheckSuiteCompletedEvent { url: string; before: string; after: string; - pull_requests: { - url: string; - id: number; - number: number; - head: { - ref: string; - sha: string; - repo: RepoRef; - }; - base: { - ref: string; - sha: string; - repo: RepoRef; - }; - }[]; + pull_requests: CheckRunPullRequest[]; app: App; created_at: string; updated_at: string; @@ -1059,21 +948,7 @@ export interface CheckSuiteRequestedEvent { url: string; before: string; after: string; - pull_requests: { - url: string; - id: number; - number: number; - head: { - ref: string; - sha: string; - repo: RepoRef; - }; - base: { - ref: string; - sha: string; - repo: RepoRef; - }; - }[]; + pull_requests: CheckRunPullRequest[]; app: App; created_at: string; updated_at: string; @@ -1109,21 +984,7 @@ export interface CheckSuiteRerequestedEvent { url: string; before: string; after: string; - pull_requests: { - url: string; - id: number; - number: number; - head: { - ref: string; - sha: string; - repo: RepoRef; - }; - base: { - ref: string; - sha: string; - repo: RepoRef; - }; - }[]; + pull_requests: CheckRunPullRequest[]; app: App; created_at: string; updated_at: string;