Skip to content

Commit 80132aa

Browse files
feat: octokit.actions.listArtifactsForRepo() (#45)
1 parent c5019f4 commit 80132aa

File tree

5 files changed

+167
-46
lines changed

5 files changed

+167
-46
lines changed

docs/actions/getSecret.md

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -35,16 +35,6 @@ repo parameter
3535

3636
name parameter
3737

38-
</td></tr>
39-
<tr><td>per_page</td><td>no</td><td>
40-
41-
Results per page (max 100)
42-
43-
</td></tr>
44-
<tr><td>page</td><td>no</td><td>
45-
46-
Page number of the results to fetch.
47-
4838
</td></tr>
4939
</tbody>
5040
</table>
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# List artifacts for a repository
2+
3+
Lists all artifacts for a repository. Anyone with read access to the repository can use this endpoint. GitHub Apps must have the `actions` permission to use this endpoint.
4+
5+
```js
6+
octokit.actions.listArtifactsForRepo({
7+
owner,
8+
repo
9+
});
10+
```
11+
12+
## Parameters
13+
14+
<table>
15+
<thead>
16+
<tr>
17+
<th>name</th>
18+
<th>required</th>
19+
<th>description</th>
20+
</tr>
21+
</thead>
22+
<tbody>
23+
<tr><td>owner</td><td>yes</td><td>
24+
25+
owner parameter
26+
27+
</td></tr>
28+
<tr><td>repo</td><td>yes</td><td>
29+
30+
repo parameter
31+
32+
</td></tr>
33+
<tr><td>per_page</td><td>no</td><td>
34+
35+
Results per page (max 100)
36+
37+
</td></tr>
38+
<tr><td>page</td><td>no</td><td>
39+
40+
Page number of the results to fetch.
41+
42+
</td></tr>
43+
</tbody>
44+
</table>
45+
46+
See also: [GitHub Developer Guide documentation](endpoint.documentationUrl).

scripts/update-endpoints/generated/endpoints.json

Lines changed: 81 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -10792,6 +10792,85 @@
1079210792
],
1079310793
"renamed": null
1079410794
},
10795+
{
10796+
"name": "List artifacts for a repository",
10797+
"scope": "actions",
10798+
"id": "listArtifactsForRepo",
10799+
"method": "GET",
10800+
"url": "/repos/{owner}/{repo}/actions/artifacts",
10801+
"isDeprecated": false,
10802+
"isLegacy": false,
10803+
"description": "Lists all artifacts for a repository. Anyone with read access to the repository can use this endpoint. GitHub Apps must have the `actions` permission to use this endpoint.",
10804+
"documentationUrl": "https://developer.github.com/v3/actions/artifacts/#list-artifacts-for-a-repository",
10805+
"previews": [],
10806+
"headers": [],
10807+
"parameters": [
10808+
{
10809+
"name": "owner",
10810+
"description": "owner parameter",
10811+
"in": "PATH",
10812+
"type": "string",
10813+
"required": true,
10814+
"enum": null,
10815+
"allowNull": false,
10816+
"mapToData": null,
10817+
"validation": null,
10818+
"alias": null,
10819+
"deprecated": null
10820+
},
10821+
{
10822+
"name": "repo",
10823+
"description": "repo parameter",
10824+
"in": "PATH",
10825+
"type": "string",
10826+
"required": true,
10827+
"enum": null,
10828+
"allowNull": false,
10829+
"mapToData": null,
10830+
"validation": null,
10831+
"alias": null,
10832+
"deprecated": null
10833+
},
10834+
{
10835+
"name": "per_page",
10836+
"description": "Results per page (max 100)",
10837+
"in": "QUERY",
10838+
"type": "integer",
10839+
"required": false,
10840+
"enum": null,
10841+
"allowNull": false,
10842+
"mapToData": null,
10843+
"validation": null,
10844+
"alias": null,
10845+
"deprecated": null
10846+
},
10847+
{
10848+
"name": "page",
10849+
"description": "Page number of the results to fetch.",
10850+
"in": "QUERY",
10851+
"type": "integer",
10852+
"required": false,
10853+
"enum": null,
10854+
"allowNull": false,
10855+
"mapToData": null,
10856+
"validation": null,
10857+
"alias": null,
10858+
"deprecated": null
10859+
}
10860+
],
10861+
"responses": [
10862+
{
10863+
"code": 200,
10864+
"description": "response",
10865+
"examples": [
10866+
{
10867+
"data": "{\"total_count\":2,\"artifacts\":[{\"id\":11,\"node_id\":\"MDg6QXJ0aWZhY3QxMQ==\",\"name\":\"Rails\",\"size_in_bytes\":556,\"url\":\"https://api.github.com/repos/octo-org/octo-docs/actions/artifacts/11\",\"archive_download_url\":\"https://api.github.com/repos/octo-org/octo-docs/actions/artifacts/11/zip\",\"expired\":\"false\",\"created_at\":\"2020-01-10T14:59:22Z\",\"expires_at\":\"2020-01-21T14:59:22Z\"},{\"id\":13,\"node_id\":\"MDg6QXJ0aWZhY3QxMw==\",\"name\":\"\",\"size_in_bytes\":453,\"url\":\"https://api.github.com/repos/octo-org/octo-docs/actions/artifacts/13\",\"archive_download_url\":\"https://api.github.com/repos/octo-org/octo-docs/actions/artifacts/13/zip\",\"expired\":\"false\",\"created_at\":\"2020-01-10T14:59:22Z\",\"expires_at\":\"2020-01-21T14:59:22Z\"}]}"
10868+
}
10869+
]
10870+
}
10871+
],
10872+
"renamed": null
10873+
},
1079510874
{
1079610875
"name": "Get an artifact",
1079710876
"scope": "actions",
@@ -10851,7 +10930,7 @@
1085110930
"description": "response",
1085210931
"examples": [
1085310932
{
10854-
"data": "{\"id\":11,\"node_id\":\"MDg6QXJ0aWZhY3QxMQ==\",\"name\":\"Rails\",\"size_in_bytes\":556,\"archive_download_url\":\"https://api.github.com/repos/octo-org/octo-docs/actions/artifacts/5/zip\",\"expired\":\"false\",\"created_at\":\"2020-01-10T14:59:22Z\",\"expires_at\":\"2020-01-21T14:59:22Z\"}"
10933+
"data": "{\"id\":11,\"node_id\":\"MDg6QXJ0aWZhY3QxMQ==\",\"name\":\"Rails\",\"size_in_bytes\":556,\"url\":\"https://api.github.com/repos/octo-org/octo-docs/actions/artifacts/11\",\"archive_download_url\":\"https://api.github.com/repos/octo-org/octo-docs/actions/artifacts/11/zip\",\"expired\":\"false\",\"created_at\":\"2020-01-10T14:59:22Z\",\"expires_at\":\"2020-01-21T14:59:22Z\"}"
1085510934
}
1085610935
]
1085710936
}
@@ -11773,7 +11852,7 @@
1177311852
"description": "response",
1177411853
"examples": [
1177511854
{
11776-
"data": "{\"total_count\":2,\"artifacts\":[{\"id\":11,\"node_id\":\"MDg6QXJ0aWZhY3QxMQ==\",\"name\":\"Rails\",\"size_in_bytes\":556,\"archive_download_url\":\"https://api.github.com/repos/octo-org/octo-docs/actions/artifacts/5/zip\",\"expired\":\"false\",\"created_at\":\"2020-01-10T14:59:22Z\",\"expires_at\":\"2020-01-21T14:59:22Z\"},{\"id\":13,\"node_id\":\"MDg6QXJ0aWZhY3QxMw==\",\"name\":\"\",\"size_in_bytes\":453,\"archive_download_url\":\"https://api.github.com/repos/octo-org/octo-docs/actions/artifacts/5/zip\",\"expired\":\"false\",\"created_at\":\"2020-01-10T14:59:22Z\",\"expires_at\":\"2020-01-21T14:59:22Z\"}]}"
11855+
"data": "{\"total_count\":2,\"artifacts\":[{\"id\":11,\"node_id\":\"MDg6QXJ0aWZhY3QxMQ==\",\"name\":\"Rails\",\"size_in_bytes\":556,\"url\":\"https://api.github.com/repos/octo-org/octo-docs/actions/artifacts/11\",\"archive_download_url\":\"https://api.github.com/repos/octo-org/octo-docs/actions/artifacts/11/zip\",\"expired\":\"false\",\"created_at\":\"2020-01-10T14:59:22Z\",\"expires_at\":\"2020-01-21T14:59:22Z\"},{\"id\":13,\"node_id\":\"MDg6QXJ0aWZhY3QxMw==\",\"name\":\"\",\"size_in_bytes\":453,\"url\":\"https://api.github.com/repos/octo-org/octo-docs/actions/artifacts/13\",\"archive_download_url\":\"https://api.github.com/repos/octo-org/octo-docs/actions/artifacts/13/zip\",\"expired\":\"false\",\"created_at\":\"2020-01-10T14:59:22Z\",\"expires_at\":\"2020-01-21T14:59:22Z\"}]}"
1177711856
}
1177811857
]
1177911858
}
@@ -12249,32 +12328,6 @@
1224912328
"validation": null,
1225012329
"alias": null,
1225112330
"deprecated": null
12252-
},
12253-
{
12254-
"name": "per_page",
12255-
"description": "Results per page (max 100)",
12256-
"in": "QUERY",
12257-
"type": "integer",
12258-
"required": false,
12259-
"enum": null,
12260-
"allowNull": false,
12261-
"mapToData": null,
12262-
"validation": null,
12263-
"alias": null,
12264-
"deprecated": null
12265-
},
12266-
{
12267-
"name": "page",
12268-
"description": "Page number of the results to fetch.",
12269-
"in": "QUERY",
12270-
"type": "integer",
12271-
"required": false,
12272-
"enum": null,
12273-
"allowNull": false,
12274-
"mapToData": null,
12275-
"validation": null,
12276-
"alias": null,
12277-
"deprecated": null
1227812331
}
1227912332
],
1228012333
"responses": [

src/generated/endpoints.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ const Endpoints: EndpointsDefaultsAndDecorations = {
3131
getWorkflow: ["GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}"],
3232
getWorkflowJob: ["GET /repos/{owner}/{repo}/actions/jobs/{job_id}"],
3333
getWorkflowRun: ["GET /repos/{owner}/{repo}/actions/runs/{run_id}"],
34+
listArtifactsForRepo: ["GET /repos/{owner}/{repo}/actions/artifacts"],
3435
listDownloadsForSelfHostedRunnerApplication: [
3536
"GET /repos/{owner}/{repo}/actions/runners/downloads"
3637
],

src/generated/types.ts

Lines changed: 39 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20109,6 +20109,7 @@ type ActionsListWorkflowRunArtifactsResponseArtifactsItem = {
2010920109
name: string;
2011020110
node_id: string;
2011120111
size_in_bytes: number;
20112+
url: string;
2011220113
};
2011320114
type ActionsListWorkflowRunArtifactsResponse = {
2011420115
artifacts: Array<ActionsListWorkflowRunArtifactsResponseArtifactsItem>;
@@ -20361,6 +20362,21 @@ type ActionsListDownloadsForSelfHostedRunnerApplicationResponseItem = {
2036120362
filename: string;
2036220363
os: string;
2036320364
};
20365+
type ActionsListArtifactsForRepoResponseArtifactsItem = {
20366+
archive_download_url: string;
20367+
created_at: string;
20368+
expired: string;
20369+
expires_at: string;
20370+
id: number;
20371+
name: string;
20372+
node_id: string;
20373+
size_in_bytes: number;
20374+
url: string;
20375+
};
20376+
type ActionsListArtifactsForRepoResponse = {
20377+
artifacts: Array<ActionsListArtifactsForRepoResponseArtifactsItem>;
20378+
total_count: number;
20379+
};
2036420380
type ActionsGetWorkflowRunResponseRepositoryOwner = {
2036520381
avatar_url: string;
2036620382
events_url: string;
@@ -20596,6 +20612,7 @@ type ActionsGetArtifactResponse = {
2059620612
name: string;
2059720613
node_id: string;
2059820614
size_in_bytes: number;
20615+
url: string;
2059920616
};
2060020617
type ActionsCreateRemoveTokenResponse = { expires_at: string; token: string };
2060120618
type ActionsCreateRegistrationTokenResponse = {
@@ -20965,14 +20982,6 @@ export type ActionsGetPublicKeyParams = {
2096520982
export type ActionsGetSecretParams = {
2096620983
name: string;
2096720984
owner: string;
20968-
/**
20969-
* Page number of the results to fetch.
20970-
*/
20971-
page?: number;
20972-
/**
20973-
* Results per page (max 100)
20974-
*/
20975-
per_page?: number;
2097620985
repo: string;
2097720986
};
2097820987
export type ActionsGetSelfHostedRunnerParams = {
@@ -20995,6 +21004,18 @@ export type ActionsGetWorkflowRunParams = {
2099521004
repo: string;
2099621005
run_id: number;
2099721006
};
21007+
export type ActionsListArtifactsForRepoParams = {
21008+
owner: string;
21009+
/**
21010+
* Page number of the results to fetch.
21011+
*/
21012+
page?: number;
21013+
/**
21014+
* Results per page (max 100)
21015+
*/
21016+
per_page?: number;
21017+
repo: string;
21018+
};
2099821019
export type ActionsListDownloadsForSelfHostedRunnerApplicationParams = {
2099921020
owner: string;
2100021021
repo: string;
@@ -27441,6 +27462,16 @@ export type RestEndpointMethods = {
2744127462

2744227463
endpoint: EndpointInterface;
2744327464
};
27465+
/**
27466+
* Lists all artifacts for a repository. Anyone with read access to the repository can use this endpoint. GitHub Apps must have the `actions` permission to use this endpoint.
27467+
*/
27468+
listArtifactsForRepo: {
27469+
(params?: RequestParameters & ActionsListArtifactsForRepoParams): Promise<
27470+
OctokitResponse<ActionsListArtifactsForRepoResponse>
27471+
>;
27472+
27473+
endpoint: EndpointInterface;
27474+
};
2744427475
/**
2744527476
* Lists binaries for the self-hosted runner application that you can download and run. Anyone with admin access to the repository can use this endpoint. GitHub Apps must have the `administration` permission to use this endpoint.
2744627477
*/

0 commit comments

Comments
 (0)