Skip to content

Commit

Permalink
feat(typescript): new deployment object for CheckRunEvent #381
Browse files Browse the repository at this point in the history
  • Loading branch information
octokitbot authored Feb 24, 2021
1 parent 86d79ec commit b2b91c5
Show file tree
Hide file tree
Showing 9 changed files with 131 additions and 8 deletions.
24 changes: 23 additions & 1 deletion cache/webhook-events-and-payloads.html
Original file line number Diff line number Diff line change
Expand Up @@ -571,6 +571,15 @@ <h4 id="webhook-payload-object">
empty.
</td>
</tr>
<tr>
<td><code>deployment</code></td>
<td><code>object</code></td>
<td>
A deployment to a repository environment. This will only be populated
if the check run was created by a GitHub Actions workflow job that
references an environment.
</td>
</tr>
<tr>
<td><code>requested_action</code></td>
<td><code>object</code></td>
Expand Down Expand Up @@ -812,7 +821,20 @@ <h4 id="webhook-payload-example">
}
}
}
]
],
<span class="hljs-attr">"deployment"</span>: {
<span class="hljs-attr">"url"</span>: <span class="hljs-string">"https://api.github.com/repos/Codertocat/Hello-World/deployments/326191728"</span>,
<span class="hljs-attr">"id"</span>: <span class="hljs-number">326191728</span>,
<span class="hljs-attr">"node_id"</span>: <span class="hljs-string">"MDEwOkRlcGxveW1lbnQzMjYxOTE3Mjg="</span>,
<span class="hljs-attr">"task"</span>: <span class="hljs-string">"deploy"</span>,
<span class="hljs-attr">"original_environment"</span>: <span class="hljs-string">"lab"</span>,
<span class="hljs-attr">"environment"</span>: <span class="hljs-string">"lab"</span>,
<span class="hljs-attr">"description"</span>: <span class="hljs-literal">null</span>,
<span class="hljs-attr">"created_at"</span>: <span class="hljs-string">"2021-02-18T08:22:48Z"</span>,
<span class="hljs-attr">"updated_at"</span>: <span class="hljs-string">"2021-02-18T09:47:16Z"</span>,
<span class="hljs-attr">"statuses_url"</span>: <span class="hljs-string">"https://api.github.com/repos/Codertocat/Hello-World/deployments/326191728/statuses"</span>,
<span class="hljs-attr">"repository_url"</span>: <span class="hljs-string">"https://api.github.com/repos/Codertocat/Hello-World"</span>
}
},
<span class="hljs-attr">"repository"</span>: {
<span class="hljs-attr">"id"</span>: <span class="hljs-number">186853002</span>,
Expand Down
34 changes: 32 additions & 2 deletions index.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@
"type": "array",
"description": "An array of pull requests that match this check suite. A pull request matches a check suite if they have the same `head_sha` and `head_branch`. When the check suite's `head_branch` is in a forked repository it will be `null` and the `pull_requests` array will be empty."
},
"deployment": {
"type": "object",
"description": "A deployment to a repository environment. This will only be populated if the check run was created by a GitHub Actions workflow job that references an environment."
},
"requested_action": {
"type": "object",
"description": "The action requested by the user."
Expand Down Expand Up @@ -242,7 +246,20 @@
}
}
}
]
],
"deployment": {
"url": "https://api.github.com/repos/Codertocat/Hello-World/deployments/326191728",
"id": 326191728,
"node_id": "MDEwOkRlcGxveW1lbnQzMjYxOTE3Mjg=",
"task": "deploy",
"original_environment": "lab",
"environment": "lab",
"description": null,
"created_at": "2021-02-18T08:22:48Z",
"updated_at": "2021-02-18T09:47:16Z",
"statuses_url": "https://api.github.com/repos/Codertocat/Hello-World/deployments/326191728/statuses",
"repository_url": "https://api.github.com/repos/Codertocat/Hello-World"
}
},
"repository": {
"id": 186853002,
Expand Down Expand Up @@ -1471,7 +1488,20 @@
}
}
}
]
],
"deployment": {
"url": "https://api.github.com/repos/Codertocat/Hello-World/deployments/326191728",
"id": 326191728,
"node_id": "MDEwOkRlcGxveW1lbnQzMjYxOTE3Mjg=",
"task": "deploy",
"original_environment": "lab",
"environment": "lab",
"description": null,
"created_at": "2021-02-18T08:22:48Z",
"updated_at": "2021-02-18T09:47:16Z",
"statuses_url": "https://api.github.com/repos/Codertocat/Hello-World/deployments/326191728/statuses",
"repository_url": "https://api.github.com/repos/Codertocat/Hello-World"
}
},
"repository": {
"id": 186853002,
Expand Down
15 changes: 14 additions & 1 deletion payload-examples/api.github.com/check_run/created.payload.json
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,20 @@
}
}
}
]
],
"deployment": {
"url": "https://api.github.com/repos/Codertocat/Hello-World/deployments/326191728",
"id": 326191728,
"node_id": "MDEwOkRlcGxveW1lbnQzMjYxOTE3Mjg=",
"task": "deploy",
"original_environment": "lab",
"environment": "lab",
"description": null,
"created_at": "2021-02-18T08:22:48Z",
"updated_at": "2021-02-18T09:47:16Z",
"statuses_url": "https://api.github.com/repos/Codertocat/Hello-World/deployments/326191728/statuses",
"repository_url": "https://api.github.com/repos/Codertocat/Hello-World"
}
},
"repository": {
"id": 186853002,
Expand Down
3 changes: 2 additions & 1 deletion payload-schemas/schemas/check_run/completed.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,8 @@
},
"additionalProperties": false
}
}
},
"deployment": { "$ref": "common/check-run-deployment.schema.json" }
},
"additionalProperties": false
},
Expand Down
3 changes: 2 additions & 1 deletion payload-schemas/schemas/check_run/created.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,8 @@
},
"additionalProperties": false
}
}
},
"deployment": { "$ref": "common/check-run-deployment.schema.json" }
},
"additionalProperties": false
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,8 @@
},
"additionalProperties": false
}
}
},
"deployment": { "$ref": "common/check-run-deployment.schema.json" }
},
"additionalProperties": false
},
Expand Down
3 changes: 2 additions & 1 deletion payload-schemas/schemas/check_run/rerequested.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,8 @@
},
"additionalProperties": false
}
}
},
"deployment": { "$ref": "common/check-run-deployment.schema.json" }
},
"additionalProperties": false
},
Expand Down
34 changes: 34 additions & 0 deletions payload-schemas/schemas/common/check-run-deployment.schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"$schema": "http://json-schema.org/draft-07/schema",
"$id": "common/check-run-deployment.schema.json",
"type": "object",
"required": [
"url",
"id",
"node_id",
"task",
"original_environment",
"environment",
"description",
"created_at",
"updated_at",
"statuses_url",
"repository_url"
],
"properties": {
"url": { "type": "string", "format": "uri" },
"id": { "type": "integer" },
"node_id": { "type": "string" },
"task": { "type": "string" },
"original_environment": { "type": "string" },
"environment": { "type": "string" },
"description": { "type": ["string", "null"] },
"created_at": { "type": "string", "format": "date-time" },
"updated_at": { "type": "string", "format": "date-time" },
"statuses_url": { "type": "string", "format": "uri" },
"repository_url": { "type": "string", "format": "uri" }
},
"additionalProperties": false,
"description": "A deployment to a repository environment. This will only be populated if the check run was created by a GitHub Actions workflow job that references an environment.",
"title": "Check Run Deployment"
}
20 changes: 20 additions & 0 deletions schema.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -351,6 +351,7 @@ export interface CheckRunCompletedEvent {
repo: RepoRef;
};
}[];
deployment?: CheckRunDeployment;
};
requested_action?: {
identifier?: string;
Expand Down Expand Up @@ -443,6 +444,22 @@ export interface User {
type: "Bot" | "User" | "Organization";
site_admin: boolean;
}
/**
* A deployment to a repository environment. This will only be populated if the check run was created by a GitHub Actions workflow job that references an environment.
*/
export interface CheckRunDeployment {
url: string;
id: number;
node_id: string;
task: string;
original_environment: string;
environment: string;
description: string | null;
created_at: string;
updated_at: string;
statuses_url: string;
repository_url: string;
}
/**
* A git repository
*/
Expand Down Expand Up @@ -709,6 +726,7 @@ export interface CheckRunCreatedEvent {
repo: RepoRef;
};
}[];
deployment?: CheckRunDeployment;
};
requested_action?: {
identifier?: string;
Expand Down Expand Up @@ -825,6 +843,7 @@ export interface CheckRunRequestedActionEvent {
repo: RepoRef;
};
}[];
deployment?: CheckRunDeployment;
};
requested_action?: {
identifier?: string;
Expand Down Expand Up @@ -940,6 +959,7 @@ export interface CheckRunRerequestedEvent {
repo: RepoRef;
};
}[];
deployment?: CheckRunDeployment;
};
requested_action?: {
identifier?: string;
Expand Down

0 comments on commit b2b91c5

Please sign in to comment.