Skip to content

Commit dfc6f58

Browse files
authored
feat: GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}/jobs (#465)
1 parent 5b5e5f6 commit dfc6f58

File tree

7 files changed

+213
-16
lines changed

7 files changed

+213
-16
lines changed
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
---
2+
name: List jobs for a workflow run attempt
3+
example: octokit.rest.actions.listJobsForWorkflowRunAttempt({ owner, repo, run_id, attempt_number })
4+
route: GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}/jobs
5+
scope: actions
6+
type: API method
7+
---
8+
9+
# List jobs for a workflow run attempt
10+
11+
Lists jobs for a specific workflow run attempt. Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the `repo` scope. GitHub Apps must have the `actions:read` permission to use this endpoint. You can use parameters to narrow the list of results. For more information about using parameters, see [Parameters](https://docs.github.com/rest/overview/resources-in-the-rest-api#parameters).
12+
13+
```js
14+
octokit.rest.actions.listJobsForWorkflowRunAttempt({
15+
owner,
16+
repo,
17+
run_id,
18+
attempt_number,
19+
});
20+
```
21+
22+
## Parameters
23+
24+
<table>
25+
<thead>
26+
<tr>
27+
<th>name</th>
28+
<th>required</th>
29+
<th>description</th>
30+
</tr>
31+
</thead>
32+
<tbody>
33+
<tr><td>owner</td><td>yes</td><td>
34+
35+
</td></tr>
36+
<tr><td>repo</td><td>yes</td><td>
37+
38+
</td></tr>
39+
<tr><td>run_id</td><td>yes</td><td>
40+
41+
The id of the workflow run.
42+
43+
</td></tr>
44+
<tr><td>attempt_number</td><td>yes</td><td>
45+
46+
The attempt number of the workflow run.
47+
48+
</td></tr>
49+
<tr><td>per_page</td><td>no</td><td>
50+
51+
Results per page (max 100)
52+
53+
</td></tr>
54+
<tr><td>page</td><td>no</td><td>
55+
56+
Page number of the results to fetch.
57+
58+
</td></tr>
59+
</tbody>
60+
</table>
61+
62+
See also: [GitHub Developer Guide documentation](https://docs.github.com/rest/reference/actions#list-jobs-for-a-workflow-run-attempt).

package-lock.json

Lines changed: 15 additions & 15 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
"author": "Gregor Martynus (https://twitter.com/gr2m)",
2525
"license": "MIT",
2626
"dependencies": {
27-
"@octokit/types": "^6.33.0",
27+
"@octokit/types": "^6.34.0",
2828
"deprecation": "^2.3.1"
2929
},
3030
"devDependencies": {

scripts/update-endpoints/generated/endpoints.json

Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3272,6 +3272,113 @@
32723272
],
32733273
"renamed": null
32743274
},
3275+
{
3276+
"name": "List jobs for a workflow run attempt",
3277+
"scope": "actions",
3278+
"id": "listJobsForWorkflowRunAttempt",
3279+
"method": "GET",
3280+
"url": "/repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}/jobs",
3281+
"isDeprecated": false,
3282+
"deprecationDate": null,
3283+
"removalDate": null,
3284+
"description": "Lists jobs for a specific workflow run attempt. Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the `repo` scope. GitHub Apps must have the `actions:read` permission to use this endpoint. You can use parameters to narrow the list of results. For more information about using parameters, see [Parameters](https://docs.github.com/rest/overview/resources-in-the-rest-api#parameters).",
3285+
"documentationUrl": "https://docs.github.com/rest/reference/actions#list-jobs-for-a-workflow-run-attempt",
3286+
"previews": [],
3287+
"headers": [],
3288+
"parameters": [
3289+
{
3290+
"name": "owner",
3291+
"description": "",
3292+
"in": "PATH",
3293+
"type": "string",
3294+
"required": true,
3295+
"enum": null,
3296+
"allowNull": false,
3297+
"mapToData": null,
3298+
"validation": null,
3299+
"alias": null,
3300+
"deprecated": null
3301+
},
3302+
{
3303+
"name": "repo",
3304+
"description": "",
3305+
"in": "PATH",
3306+
"type": "string",
3307+
"required": true,
3308+
"enum": null,
3309+
"allowNull": false,
3310+
"mapToData": null,
3311+
"validation": null,
3312+
"alias": null,
3313+
"deprecated": null
3314+
},
3315+
{
3316+
"name": "run_id",
3317+
"description": "The id of the workflow run.",
3318+
"in": "PATH",
3319+
"type": "integer",
3320+
"required": true,
3321+
"enum": null,
3322+
"allowNull": false,
3323+
"mapToData": null,
3324+
"validation": null,
3325+
"alias": null,
3326+
"deprecated": null
3327+
},
3328+
{
3329+
"name": "attempt_number",
3330+
"description": "The attempt number of the workflow run.",
3331+
"in": "PATH",
3332+
"type": "integer",
3333+
"required": true,
3334+
"enum": null,
3335+
"allowNull": false,
3336+
"mapToData": null,
3337+
"validation": null,
3338+
"alias": null,
3339+
"deprecated": null
3340+
},
3341+
{
3342+
"name": "per_page",
3343+
"description": "Results per page (max 100)",
3344+
"in": "QUERY",
3345+
"type": "integer",
3346+
"required": false,
3347+
"enum": null,
3348+
"allowNull": false,
3349+
"mapToData": null,
3350+
"validation": null,
3351+
"alias": null,
3352+
"deprecated": null
3353+
},
3354+
{
3355+
"name": "page",
3356+
"description": "Page number of the results to fetch.",
3357+
"in": "QUERY",
3358+
"type": "integer",
3359+
"required": false,
3360+
"enum": null,
3361+
"allowNull": false,
3362+
"mapToData": null,
3363+
"validation": null,
3364+
"alias": null,
3365+
"deprecated": null
3366+
}
3367+
],
3368+
"responses": [
3369+
{
3370+
"code": 200,
3371+
"description": "Response",
3372+
"examples": [
3373+
{
3374+
"data": "{\"total_count\":1,\"jobs\":[{\"id\":399444496,\"run_id\":29679449,\"run_url\":\"https://api.github.com/repos/octo-org/octo-repo/actions/runs/29679449\",\"node_id\":\"MDEyOldvcmtmbG93IEpvYjM5OTQ0NDQ5Ng==\",\"head_sha\":\"f83a356604ae3c5d03e1b46ef4d1ca77d64a90b0\",\"url\":\"https://api.github.com/repos/octo-org/octo-repo/actions/jobs/399444496\",\"html_url\":\"https://github.com/octo-org/octo-repo/runs/399444496\",\"status\":\"completed\",\"conclusion\":\"success\",\"started_at\":\"2020-01-20T17:42:40Z\",\"completed_at\":\"2020-01-20T17:44:39Z\",\"name\":\"build\",\"steps\":[{\"name\":\"Set up job\",\"status\":\"completed\",\"conclusion\":\"success\",\"number\":1,\"started_at\":\"2020-01-20T09:42:40.000-08:00\",\"completed_at\":\"2020-01-20T09:42:41.000-08:00\"},{\"name\":\"Run actions/checkout@v2\",\"status\":\"completed\",\"conclusion\":\"success\",\"number\":2,\"started_at\":\"2020-01-20T09:42:41.000-08:00\",\"completed_at\":\"2020-01-20T09:42:45.000-08:00\"},{\"name\":\"Set up Ruby\",\"status\":\"completed\",\"conclusion\":\"success\",\"number\":3,\"started_at\":\"2020-01-20T09:42:45.000-08:00\",\"completed_at\":\"2020-01-20T09:42:45.000-08:00\"},{\"name\":\"Run actions/cache@v2\",\"status\":\"completed\",\"conclusion\":\"success\",\"number\":4,\"started_at\":\"2020-01-20T09:42:45.000-08:00\",\"completed_at\":\"2020-01-20T09:42:48.000-08:00\"},{\"name\":\"Install Bundler\",\"status\":\"completed\",\"conclusion\":\"success\",\"number\":5,\"started_at\":\"2020-01-20T09:42:48.000-08:00\",\"completed_at\":\"2020-01-20T09:42:52.000-08:00\"},{\"name\":\"Install Gems\",\"status\":\"completed\",\"conclusion\":\"success\",\"number\":6,\"started_at\":\"2020-01-20T09:42:52.000-08:00\",\"completed_at\":\"2020-01-20T09:42:53.000-08:00\"},{\"name\":\"Run Tests\",\"status\":\"completed\",\"conclusion\":\"success\",\"number\":7,\"started_at\":\"2020-01-20T09:42:53.000-08:00\",\"completed_at\":\"2020-01-20T09:42:59.000-08:00\"},{\"name\":\"Deploy to Heroku\",\"status\":\"completed\",\"conclusion\":\"success\",\"number\":8,\"started_at\":\"2020-01-20T09:42:59.000-08:00\",\"completed_at\":\"2020-01-20T09:44:39.000-08:00\"},{\"name\":\"Post actions/cache@v2\",\"status\":\"completed\",\"conclusion\":\"success\",\"number\":16,\"started_at\":\"2020-01-20T09:44:39.000-08:00\",\"completed_at\":\"2020-01-20T09:44:39.000-08:00\"},{\"name\":\"Complete job\",\"status\":\"completed\",\"conclusion\":\"success\",\"number\":17,\"started_at\":\"2020-01-20T09:44:39.000-08:00\",\"completed_at\":\"2020-01-20T09:44:39.000-08:00\"}],\"check_run_url\":\"https://api.github.com/repos/octo-org/octo-repo/check-runs/399444496\",\"labels\":[\"self-hosted\",\"foo\",\"bar\"],\"runner_id\":1,\"runner_name\":\"my runner\",\"runner_group_id\":2,\"runner_group_name\":\"my runner group\"}]}"
3375+
}
3376+
]
3377+
},
3378+
{ "code": 404, "description": "Resource not found", "examples": null }
3379+
],
3380+
"renamed": null
3381+
},
32753382
{
32763383
"name": "List organization secrets",
32773384
"scope": "actions",
@@ -49354,6 +49461,11 @@
4935449461
"data": "{\"url\":\"https://api.github.com/repos/octocat/Hello-World/releases/assets/1\",\"browser_download_url\":\"https://github.com/octocat/Hello-World/releases/download/v1.0.0/example.zip\",\"id\":1,\"node_id\":\"MDEyOlJlbGVhc2VBc3NldDE=\",\"name\":\"example.zip\",\"label\":\"short description\",\"state\":\"uploaded\",\"content_type\":\"application/zip\",\"size\":1024,\"download_count\":42,\"created_at\":\"2013-02-27T19:35:32Z\",\"updated_at\":\"2013-02-27T19:35:32Z\",\"uploader\":{\"login\":\"octocat\",\"id\":1,\"node_id\":\"MDQ6VXNlcjE=\",\"avatar_url\":\"https://github.com/images/error/octocat_happy.gif\",\"gravatar_id\":\"\",\"url\":\"https://api.github.com/users/octocat\",\"html_url\":\"https://github.com/octocat\",\"followers_url\":\"https://api.github.com/users/octocat/followers\",\"following_url\":\"https://api.github.com/users/octocat/following{/other_user}\",\"gists_url\":\"https://api.github.com/users/octocat/gists{/gist_id}\",\"starred_url\":\"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\"subscriptions_url\":\"https://api.github.com/users/octocat/subscriptions\",\"organizations_url\":\"https://api.github.com/users/octocat/orgs\",\"repos_url\":\"https://api.github.com/users/octocat/repos\",\"events_url\":\"https://api.github.com/users/octocat/events{/privacy}\",\"received_events_url\":\"https://api.github.com/users/octocat/received_events\",\"type\":\"User\",\"site_admin\":false}}"
4935549462
}
4935649463
]
49464+
},
49465+
{
49466+
"code": 422,
49467+
"description": "Response if you upload an asset with the same filename as another uploaded asset",
49468+
"examples": null
4935749469
}
4935849470
],
4935949471
"renamed": null

src/generated/endpoints.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,9 @@ const Endpoints: EndpointsDefaultsAndDecorations = {
131131
listJobsForWorkflowRun: [
132132
"GET /repos/{owner}/{repo}/actions/runs/{run_id}/jobs",
133133
],
134+
listJobsForWorkflowRunAttempt: [
135+
"GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}/jobs",
136+
],
134137
listOrgSecrets: ["GET /orgs/{org}/actions/secrets"],
135138
listRepoSecrets: ["GET /repos/{owner}/{repo}/actions/secrets"],
136139
listRepoWorkflows: ["GET /repos/{owner}/{repo}/actions/workflows"],

src/generated/method-types.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -944,6 +944,18 @@ export type RestEndpointMethods = {
944944
defaults: RequestInterface["defaults"];
945945
endpoint: EndpointInterface<{ url: string }>;
946946
};
947+
/**
948+
* Lists jobs for a specific workflow run attempt. Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the `repo` scope. GitHub Apps must have the `actions:read` permission to use this endpoint. You can use parameters to narrow the list of results. For more information about using parameters, see [Parameters](https://docs.github.com/rest/overview/resources-in-the-rest-api#parameters).
949+
*/
950+
listJobsForWorkflowRunAttempt: {
951+
(
952+
params?: RestEndpointMethodTypes["actions"]["listJobsForWorkflowRunAttempt"]["parameters"]
953+
): Promise<
954+
RestEndpointMethodTypes["actions"]["listJobsForWorkflowRunAttempt"]["response"]
955+
>;
956+
defaults: RequestInterface["defaults"];
957+
endpoint: EndpointInterface<{ url: string }>;
958+
};
947959
/**
948960
* Lists all secrets available in an organization without revealing their encrypted values. You must authenticate using an access token with the `admin:org` scope to use this endpoint. GitHub Apps must have the `secrets` organization permission to use this endpoint.
949961
*/

src/generated/parameters-and-response-types.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -418,6 +418,14 @@ export type RestEndpointMethodTypes = {
418418
>;
419419
response: Endpoints["GET /repos/{owner}/{repo}/actions/runs/{run_id}/jobs"]["response"];
420420
};
421+
listJobsForWorkflowRunAttempt: {
422+
parameters: RequestParameters &
423+
Omit<
424+
Endpoints["GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}/jobs"]["parameters"],
425+
"baseUrl" | "headers" | "mediaType"
426+
>;
427+
response: Endpoints["GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}/jobs"]["response"];
428+
};
421429
listOrgSecrets: {
422430
parameters: RequestParameters &
423431
Omit<

0 commit comments

Comments
 (0)