Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: new properties on various schemas #630

Merged
merged 15 commits into from
Jun 9, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@
"enum": ["off", "non_admins", "everyone"]
},
"admin_enforced": { "type": "boolean" },
"create_protected": { "type": "boolean" },
"allow_force_pushes_enforcement_level": {
"type": "string",
"enum": ["off", "non_admins", "everyone"]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
"properties": {
"id": { "type": "integer" },
"name": { "type": "string" },
"path": { "type": "string" },
"node_id": { "type": "string" },
"head_branch": { "type": "string" },
"head_sha": { "type": "string" },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@
"org_block",
"page_build",
"project",
"projects_v2_item",
"project_card",
"project_column",
"public",
Expand All @@ -147,6 +148,7 @@
"repository",
"repository_dispatch",
"secret_scanning_alert",
"secret_scanning_alert_location",
"star",
"status",
"team",
Expand Down
3 changes: 2 additions & 1 deletion payload-schemas/api.github.com/common/issue.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,8 @@
"description": "Contents of the issue"
},
"reactions": { "$ref": "reactions.schema.json" },
"timeline_url": { "type": "string", "format": "uri" }
"timeline_url": { "type": "string", "format": "uri" },
"state_reason": { "type": ["string", "null"] }
},
"additionalProperties": false,
"title": "Issue"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@
"created_at": { "type": "string", "format": "date-time" },
"updated_at": { "type": "string", "format": "date-time" },
"content_url": { "type": "string", "format": "uri" },
"after_id": { "type": ["string", "null"] }
"after_id": {
"oneOf": [{ "type": "string" }, { "type": "number" }, { "type": "null" }]
}
},
"additionalProperties": false,
"title": "Project Card"
Expand Down
1 change: 1 addition & 0 deletions payload-schemas/api.github.com/common/release.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
"tarball_url": { "type": ["string", "null"], "format": "uri" },
"zipball_url": { "type": ["string", "null"], "format": "uri" },
"body": { "type": "string" },
"mentions_count": { "type": "integer" },
"reactions": { "$ref": "reactions.schema.json" },
"discussion_url": { "type": "string", "format": "uri" }
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,7 @@
"description": "Whether to allow private forks"
},
"allow_update_branch": { "type": "boolean" },
"use_squash_pr_title_as_default": { "type": "boolean" },
"is_template": { "type": "boolean" },
"topics": { "type": "array", "items": { "type": "string" } },
"visibility": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
},
"conclusion": {
"type": ["string", "null"],
"enum": ["success", "failure", null]
"enum": ["success", "failure", "cancelled", "skipped", null]
},
"labels": {
"type": "array",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@
"head_commit": { "$ref": "commit-simple.schema.json" },
"head_repository": { "$ref": "repository-lite.schema.json" },
"head_sha": { "type": "string" },
"path": { "type": "string" },
"html_url": { "type": "string", "format": "uri" },
"id": { "type": "integer" },
"jobs_url": { "type": "string", "format": "uri" },
Expand Down
1 change: 1 addition & 0 deletions payload-schemas/api.github.com/member/added.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
},
"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,
Expand Down
1 change: 1 addition & 0 deletions payload-schemas/api.github.com/member/edited.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
},
"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,
Expand Down
1 change: 1 addition & 0 deletions payload-schemas/api.github.com/member/removed.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
},
"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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"$schema": "http://json-schema.org/draft-07/schema",
"$id": "project_card$moved",
"type": "object",
"required": ["action", "changes", "project_card", "sender"],
"required": ["action", "project_card", "sender"],
"properties": {
"action": { "type": "string", "enum": ["moved"] },
"changes": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@
"type": "object",
"required": ["conclusion"],
"properties": {
"conclusion": { "type": "string", "enum": ["success", "failure"] }
"conclusion": {
"type": "string",
"enum": ["success", "failure", "cancelled", "skipped"]
}
},
"tsAdditionalProperties": false
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,9 @@
{ "$ref": "common/workflow-job.schema.json" },
{
"type": "object",
"required": ["status", "steps"],
"required": ["status"],
"properties": {
"status": { "type": "string", "enum": ["in_progress"] },
"steps": {
"type": "array",
"items": {
"$ref": "common/workflow-step-in_progress.schema.json"
},
"minItems": 1
}
"status": { "type": "string", "enum": ["in_progress"] }
},
"tsAdditionalProperties": false
}
Expand Down
20 changes: 15 additions & 5 deletions payload-types/schema.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -427,6 +427,7 @@ export interface BranchProtectionRule {
| "non_admins"
| "everyone";
admin_enforced: boolean;
create_protected?: boolean;
allow_force_pushes_enforcement_level: "off" | "non_admins" | "everyone";
allow_deletions_enforcement_level: "off" | "non_admins" | "everyone";
merge_queue_enforcement_level: "off" | "non_admins" | "everyone";
Expand Down Expand Up @@ -564,6 +565,7 @@ export interface Repository {
*/
allow_forking?: boolean;
allow_update_branch?: boolean;
use_squash_pr_title_as_default?: boolean;
is_template: boolean;
topics: string[];
visibility: "public" | "private" | "internal";
Expand Down Expand Up @@ -2159,6 +2161,7 @@ export interface Workflow {
export interface DeploymentWorkflowRun {
id: number;
name: string;
path?: string;
node_id: string;
head_branch: string;
head_sha: string;
Expand Down Expand Up @@ -2754,6 +2757,7 @@ export interface Installation {
| "org_block"
| "page_build"
| "project"
| "projects_v2_item"
| "project_card"
| "project_column"
| "public"
Expand All @@ -2767,6 +2771,7 @@ export interface Installation {
| "repository"
| "repository_dispatch"
| "secret_scanning_alert"
| "secret_scanning_alert_location"
| "star"
| "status"
| "team"
Expand Down Expand Up @@ -3027,6 +3032,7 @@ export interface Issue {
body: string | null;
reactions: Reactions;
timeline_url?: string;
state_reason?: string | null;
}
/**
* A collection of related issues and pull requests.
Expand Down Expand Up @@ -3559,6 +3565,7 @@ export interface MemberAddedEvent {
member: User;
repository: Repository;
installation?: InstallationLite;
organization?: Organization;
sender: User;
}
export interface MemberEditedEvent {
Expand All @@ -3577,13 +3584,15 @@ export interface MemberEditedEvent {
};
repository: Repository;
installation?: InstallationLite;
organization?: Organization;
sender: User;
}
export interface MemberRemovedEvent {
action: "removed";
member: User;
repository: Repository;
installation?: InstallationLite;
organization?: Organization;
sender: User;
}
export interface MembershipAddedEvent {
Expand Down Expand Up @@ -4185,7 +4194,7 @@ export interface ProjectCard {
created_at: string;
updated_at: string;
content_url?: string;
after_id?: string | null;
after_id?: string | number | null;
}
export interface ProjectCardCreatedEvent {
action: "created";
Expand Down Expand Up @@ -4218,7 +4227,7 @@ export interface ProjectCardEditedEvent {
}
export interface ProjectCardMovedEvent {
action: "moved";
changes: {
changes?: {
column_id: {
from: number;
};
Expand Down Expand Up @@ -5375,6 +5384,7 @@ export interface Release {
tarball_url: string | null;
zipball_url: string | null;
body: string;
mentions_count?: number;
reactions?: Reactions;
discussion_url?: string;
}
Expand Down Expand Up @@ -6218,7 +6228,7 @@ export interface WorkflowJobCompletedEvent {
repository: Repository;
sender: User;
workflow_job: WorkflowJob & {
conclusion: "success" | "failure";
conclusion: "success" | "failure" | "cancelled" | "skipped";
};
}
/**
Expand All @@ -6240,7 +6250,7 @@ export interface WorkflowJob {
*/
status: "queued" | "in_progress" | "completed";
steps: [WorkflowStep, ...WorkflowStep[]];
conclusion: "success" | "failure" | null;
conclusion: "success" | "failure" | "cancelled" | "skipped" | null;
/**
* Custom labels for the job. Specified by the [`"runs-on"` attribute](https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idruns-on) in the workflow YAML.
*/
Expand Down Expand Up @@ -6288,7 +6298,6 @@ export interface WorkflowJobInProgressEvent {
sender: User;
workflow_job: WorkflowJob & {
status: "in_progress";
steps: [WorkflowStepInProgress, ...WorkflowStepInProgress[]];
};
}
export interface WorkflowJobQueuedEvent {
Expand Down Expand Up @@ -6361,6 +6370,7 @@ export interface WorkflowRun {
head_commit: SimpleCommit;
head_repository: RepositoryLite;
head_sha: string;
path?: string;
html_url: string;
id: number;
jobs_url: string;
Expand Down