Skip to content

Commit 5d8da0e

Browse files
feat(repos): add read-only deployment history tools
Add list_deployments and list_deployment_statuses so an agent can check which commit reached an environment and whether that deployment succeeded, using GitHub's Deployments API. list_deployments supports the API's sha, ref, task and environment filters plus pagination. list_deployment_statuses returns a deployment's statuses newest first. Both are read-only, live in the repos toolset, sanitize free-text descriptions and carry an untrusted IFC label, since deployments are usually written by CI and preview integrations. Fixes #3876
1 parent df32d7e commit 5d8da0e

11 files changed

Lines changed: 780 additions & 14 deletions

File tree

‎README.md‎

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1512,6 +1512,25 @@ For negotiated supported protocol versions `2026-07-28` or newer, the consolidat
15121512
- `since`: Only commits after this date will be returned (ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ or YYYY-MM-DD) (string, optional)
15131513
- `until`: Only commits before this date will be returned (ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ or YYYY-MM-DD) (string, optional)
15141514

1515+
- **list_deployment_statuses** - List deployment statuses
1516+
- **OAuth Challenge Scopes**: `repo`
1517+
- `deployment_id`: The deployment ID, as returned by list_deployments (number, required)
1518+
- `owner`: Repository owner (string, required)
1519+
- `page`: Page number for pagination (min 1) (number, optional)
1520+
- `perPage`: Results per page for pagination (min 1, max 100) (number, optional)
1521+
- `repo`: Repository name (string, required)
1522+
1523+
- **list_deployments** - List deployments
1524+
- **OAuth Challenge Scopes**: `repo`
1525+
- `environment`: Only return deployments to this environment (e.g. 'production' or 'staging') (string, optional)
1526+
- `owner`: Repository owner (string, required)
1527+
- `page`: Page number for pagination (min 1) (number, optional)
1528+
- `perPage`: Results per page for pagination (min 1, max 100) (number, optional)
1529+
- `ref`: Only return deployments of this ref (branch, tag or SHA name) (string, optional)
1530+
- `repo`: Repository name (string, required)
1531+
- `sha`: Only return deployments of this commit SHA (string, optional)
1532+
- `task`: Only return deployments with this task name (e.g. 'deploy' or 'deploy:migrations') (string, optional)
1533+
15151534
- **list_releases** - List releases
15161535
- **OAuth Challenge Scopes**: `repo`
15171536
- `fields`: Subset of fields to return for each release. If omitted, all fields are returned. Use this to reduce response size when you only need specific fields; omitting 'body' in particular drops the largest per-release data. (string[], optional)
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
{
2+
"annotations": {
3+
"idempotentHint": false,
4+
"readOnlyHint": true,
5+
"title": "List deployment statuses"
6+
},
7+
"description": "List the statuses of a deployment in a GitHub repository, newest first. The first status is the deployment's current state (e.g. success, failure, error, in_progress, queued, pending or inactive).",
8+
"inputSchema": {
9+
"properties": {
10+
"deployment_id": {
11+
"description": "The deployment ID, as returned by list_deployments",
12+
"type": "number"
13+
},
14+
"owner": {
15+
"description": "Repository owner",
16+
"type": "string"
17+
},
18+
"page": {
19+
"description": "Page number for pagination (min 1)",
20+
"minimum": 1,
21+
"type": "number"
22+
},
23+
"perPage": {
24+
"description": "Results per page for pagination (min 1, max 100)",
25+
"maximum": 100,
26+
"minimum": 1,
27+
"type": "number"
28+
},
29+
"repo": {
30+
"description": "Repository name",
31+
"type": "string"
32+
}
33+
},
34+
"required": [
35+
"owner",
36+
"repo",
37+
"deployment_id"
38+
],
39+
"type": "object"
40+
},
41+
"name": "list_deployment_statuses"
42+
}
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
{
2+
"annotations": {
3+
"idempotentHint": false,
4+
"readOnlyHint": true,
5+
"title": "List deployments"
6+
},
7+
"description": "List deployments in a GitHub repository, newest first. Filter by commit SHA, ref, task or environment to find which commit was deployed where. Use list_deployment_statuses to see whether a deployment succeeded.",
8+
"inputSchema": {
9+
"properties": {
10+
"environment": {
11+
"description": "Only return deployments to this environment (e.g. 'production' or 'staging')",
12+
"type": "string"
13+
},
14+
"owner": {
15+
"description": "Repository owner",
16+
"type": "string"
17+
},
18+
"page": {
19+
"description": "Page number for pagination (min 1)",
20+
"minimum": 1,
21+
"type": "number"
22+
},
23+
"perPage": {
24+
"description": "Results per page for pagination (min 1, max 100)",
25+
"maximum": 100,
26+
"minimum": 1,
27+
"type": "number"
28+
},
29+
"ref": {
30+
"description": "Only return deployments of this ref (branch, tag or SHA name)",
31+
"type": "string"
32+
},
33+
"repo": {
34+
"description": "Repository name",
35+
"type": "string"
36+
},
37+
"sha": {
38+
"description": "Only return deployments of this commit SHA",
39+
"type": "string"
40+
},
41+
"task": {
42+
"description": "Only return deployments with this task name (e.g. 'deploy' or 'deploy:migrations')",
43+
"type": "string"
44+
}
45+
},
46+
"required": [
47+
"owner",
48+
"repo"
49+
],
50+
"type": "object"
51+
},
52+
"name": "list_deployments"
53+
}

0 commit comments

Comments
 (0)