Skip to content

Commit

Permalink
feat: new properties on various schemas (#630)
Browse files Browse the repository at this point in the history
* feat: new `cancelled` conlusion for `workflow_job`
* feat: new `projects_v2_item` and `secret_scanning_alert_location` events for `installation`
* feat: new `state_reason` property for `issues`
* fix: `after_id` for `project_card` may be a number as well
* feat: `organization` is now sent for `member` events
* fix: `changes` property is not always present on `project_card.moved`
* feat: new `path` property on `WorkflowRun`
* feat: new `create_protected` property for `BranchProtectionRule`
* fix: remove the `steps` property override in `workflow_job.in_progress`
* feat: new `mentions_count` property for `release`
* feat: new `skipped` conclusion for `workflow_job`
* feat: new `use_squash_pr_title_as_default` property
This property is currently onlu present in`pull_request[head][repo]`
  • Loading branch information
wolfy1339 committed Jun 9, 2022
1 parent 121dfa7 commit f7d96ec
Show file tree
Hide file tree
Showing 16 changed files with 38 additions and 19 deletions.
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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 @@ -6221,7 +6231,7 @@ export interface WorkflowJobCompletedEvent {
repository: Repository;
sender: User;
workflow_job: WorkflowJob & {
conclusion: "success" | "failure";
conclusion: "success" | "failure" | "cancelled" | "skipped";
};
}
/**
Expand All @@ -6243,7 +6253,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 @@ -6291,7 +6301,6 @@ export interface WorkflowJobInProgressEvent {
sender: User;
workflow_job: WorkflowJob & {
status: "in_progress";
steps: [WorkflowStepInProgress, ...WorkflowStepInProgress[]];
};
}
export interface WorkflowJobQueuedEvent {
Expand Down Expand Up @@ -6364,6 +6373,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

0 comments on commit f7d96ec

Please sign in to comment.