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: GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}/jobs #465

Merged
merged 2 commits into from Oct 11, 2021
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
62 changes: 62 additions & 0 deletions docs/actions/listJobsForWorkflowRunAttempt.md
@@ -0,0 +1,62 @@
---
name: List jobs for a workflow run attempt
example: octokit.rest.actions.listJobsForWorkflowRunAttempt({ owner, repo, run_id, attempt_number })
route: GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}/jobs
scope: actions
type: API method
---

# List jobs for a workflow run attempt

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).

```js
octokit.rest.actions.listJobsForWorkflowRunAttempt({
owner,
repo,
run_id,
attempt_number,
});
```

## Parameters

<table>
<thead>
<tr>
<th>name</th>
<th>required</th>
<th>description</th>
</tr>
</thead>
<tbody>
<tr><td>owner</td><td>yes</td><td>

</td></tr>
<tr><td>repo</td><td>yes</td><td>

</td></tr>
<tr><td>run_id</td><td>yes</td><td>

The id of the workflow run.

</td></tr>
<tr><td>attempt_number</td><td>yes</td><td>

The attempt number of the workflow run.

</td></tr>
<tr><td>per_page</td><td>no</td><td>

Results per page (max 100)

</td></tr>
<tr><td>page</td><td>no</td><td>

Page number of the results to fetch.

</td></tr>
</tbody>
</table>

See also: [GitHub Developer Guide documentation](https://docs.github.com/rest/reference/actions#list-jobs-for-a-workflow-run-attempt).
30 changes: 15 additions & 15 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -24,7 +24,7 @@
"author": "Gregor Martynus (https://twitter.com/gr2m)",
"license": "MIT",
"dependencies": {
"@octokit/types": "^6.33.0",
"@octokit/types": "^6.34.0",
"deprecation": "^2.3.1"
},
"devDependencies": {
Expand Down
112 changes: 112 additions & 0 deletions scripts/update-endpoints/generated/endpoints.json
Expand Up @@ -3272,6 +3272,113 @@
],
"renamed": null
},
{
"name": "List jobs for a workflow run attempt",
"scope": "actions",
"id": "listJobsForWorkflowRunAttempt",
"method": "GET",
"url": "/repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}/jobs",
"isDeprecated": false,
"deprecationDate": null,
"removalDate": null,
"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).",
"documentationUrl": "https://docs.github.com/rest/reference/actions#list-jobs-for-a-workflow-run-attempt",
"previews": [],
"headers": [],
"parameters": [
{
"name": "owner",
"description": "",
"in": "PATH",
"type": "string",
"required": true,
"enum": null,
"allowNull": false,
"mapToData": null,
"validation": null,
"alias": null,
"deprecated": null
},
{
"name": "repo",
"description": "",
"in": "PATH",
"type": "string",
"required": true,
"enum": null,
"allowNull": false,
"mapToData": null,
"validation": null,
"alias": null,
"deprecated": null
},
{
"name": "run_id",
"description": "The id of the workflow run.",
"in": "PATH",
"type": "integer",
"required": true,
"enum": null,
"allowNull": false,
"mapToData": null,
"validation": null,
"alias": null,
"deprecated": null
},
{
"name": "attempt_number",
"description": "The attempt number of the workflow run.",
"in": "PATH",
"type": "integer",
"required": true,
"enum": null,
"allowNull": false,
"mapToData": null,
"validation": null,
"alias": null,
"deprecated": null
},
{
"name": "per_page",
"description": "Results per page (max 100)",
"in": "QUERY",
"type": "integer",
"required": false,
"enum": null,
"allowNull": false,
"mapToData": null,
"validation": null,
"alias": null,
"deprecated": null
},
{
"name": "page",
"description": "Page number of the results to fetch.",
"in": "QUERY",
"type": "integer",
"required": false,
"enum": null,
"allowNull": false,
"mapToData": null,
"validation": null,
"alias": null,
"deprecated": null
}
],
"responses": [
{
"code": 200,
"description": "Response",
"examples": [
{
"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\"}]}"
}
]
},
{ "code": 404, "description": "Resource not found", "examples": null }
],
"renamed": null
},
{
"name": "List organization secrets",
"scope": "actions",
Expand Down Expand Up @@ -49354,6 +49461,11 @@
"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}}"
}
]
},
{
"code": 422,
"description": "Response if you upload an asset with the same filename as another uploaded asset",
"examples": null
}
],
"renamed": null
Expand Down
3 changes: 3 additions & 0 deletions src/generated/endpoints.ts
Expand Up @@ -131,6 +131,9 @@ const Endpoints: EndpointsDefaultsAndDecorations = {
listJobsForWorkflowRun: [
"GET /repos/{owner}/{repo}/actions/runs/{run_id}/jobs",
],
listJobsForWorkflowRunAttempt: [
"GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}/jobs",
],
listOrgSecrets: ["GET /orgs/{org}/actions/secrets"],
listRepoSecrets: ["GET /repos/{owner}/{repo}/actions/secrets"],
listRepoWorkflows: ["GET /repos/{owner}/{repo}/actions/workflows"],
Expand Down
12 changes: 12 additions & 0 deletions src/generated/method-types.ts
Expand Up @@ -944,6 +944,18 @@ export type RestEndpointMethods = {
defaults: RequestInterface["defaults"];
endpoint: EndpointInterface<{ url: string }>;
};
/**
* 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).
*/
listJobsForWorkflowRunAttempt: {
(
params?: RestEndpointMethodTypes["actions"]["listJobsForWorkflowRunAttempt"]["parameters"]
): Promise<
RestEndpointMethodTypes["actions"]["listJobsForWorkflowRunAttempt"]["response"]
>;
defaults: RequestInterface["defaults"];
endpoint: EndpointInterface<{ url: string }>;
};
/**
* 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.
*/
Expand Down
8 changes: 8 additions & 0 deletions src/generated/parameters-and-response-types.ts
Expand Up @@ -418,6 +418,14 @@ export type RestEndpointMethodTypes = {
>;
response: Endpoints["GET /repos/{owner}/{repo}/actions/runs/{run_id}/jobs"]["response"];
};
listJobsForWorkflowRunAttempt: {
parameters: RequestParameters &
Omit<
Endpoints["GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}/jobs"]["parameters"],
"baseUrl" | "headers" | "mediaType"
>;
response: Endpoints["GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}/jobs"]["response"];
};
listOrgSecrets: {
parameters: RequestParameters &
Omit<
Expand Down