Skip to content

Commit 1fbf000

Browse files
feat: actions.downloadJobLogsForWorkflowRun, actions.getJobForWorkflowRun, actions.listWorkflowRunsForRepo, actions.createInstallationAccessToken, apps.listReposAccessibleToInstallation, apps.revokeInstallationAccessToken, interactions.setRestrictionsForOrg, interactions.setRestrictionsForRepo. Deprecates actions.downloadWorkflowJobLogs, actions.getWorkflowJob, actions.listRepoWorkflowRuns, actions.createInstallationToken, apps.listRepos, apps.revokeInstallationToken, interactions.addOrUpdateRestrictionsForOrg, interactions.addOrUpdateRestrictionsForRepo, issues.replaceAllLabels (#126)
Co-authored-by: Octokit Bot <33075676+octokitbot@users.noreply.github.com>
1 parent 51c81e9 commit 1fbf000

36 files changed

+2336
-507
lines changed
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
---
2+
name: Download job logs for a workflow run
3+
example: octokit.actions.downloadJobLogsForWorkflowRun({ owner, repo, job_id })
4+
route: GET /repos/{owner}/{repo}/actions/jobs/{job_id}/logs
5+
scope: actions
6+
type: API method
7+
---
8+
9+
# Download job logs for a workflow run
10+
11+
Gets a redirect URL to download a plain text file of logs for a workflow job. This link expires after 1 minute. Look for `Location:` in the response header to find the URL for the download. 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.
12+
13+
Call this endpoint using the `-v` flag, which enables verbose output and allows you to see the download URL in the header. To download the file into the current working directory, specify the filename using the `-o` flag.
14+
15+
```js
16+
octokit.actions.downloadJobLogsForWorkflowRun({
17+
owner,
18+
repo,
19+
job_id,
20+
});
21+
```
22+
23+
## Parameters
24+
25+
<table>
26+
<thead>
27+
<tr>
28+
<th>name</th>
29+
<th>required</th>
30+
<th>description</th>
31+
</tr>
32+
</thead>
33+
<tbody>
34+
<tr><td>owner</td><td>yes</td><td>
35+
36+
</td></tr>
37+
<tr><td>repo</td><td>yes</td><td>
38+
39+
</td></tr>
40+
<tr><td>job_id</td><td>yes</td><td>
41+
42+
</td></tr>
43+
</tbody>
44+
</table>
45+
46+
See also: [GitHub Developer Guide documentation](https://developer.github.com/v3/actions/workflow-jobs/#download-job-logs-for-a-workflow-run).

docs/actions/downloadWorkflowJobLogs.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
---
2-
name: Download workflow job logs
2+
name: Download job logs for a workflow run
33
example: octokit.actions.downloadWorkflowJobLogs({ owner, repo, job_id })
44
route: GET /repos/{owner}/{repo}/actions/jobs/{job_id}/logs
55
scope: actions
66
type: API method
77
---
88

9-
# Download workflow job logs
9+
# Download job logs for a workflow run
10+
11+
**Deprecated:** This method has been renamed to actions.downloadJobLogsForWorkflowRun
1012

1113
Gets a redirect URL to download a plain text file of logs for a workflow job. This link expires after 1 minute. Look for `Location:` in the response header to find the URL for the download. 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.
1214

@@ -43,4 +45,4 @@ octokit.actions.downloadWorkflowJobLogs({
4345
</tbody>
4446
</table>
4547

46-
See also: [GitHub Developer Guide documentation](https://developer.github.com/v3/actions/workflow-jobs/#download-workflow-job-logs).
48+
See also: [GitHub Developer Guide documentation](https://developer.github.com/v3/actions/workflow-jobs/#download-job-logs-for-a-workflow-run).
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
---
2+
name: Get a job for a workflow run
3+
example: octokit.actions.getJobForWorkflowRun({ owner, repo, job_id })
4+
route: GET /repos/{owner}/{repo}/actions/jobs/{job_id}
5+
scope: actions
6+
type: API method
7+
---
8+
9+
# Get a job for a workflow run
10+
11+
Gets a specific job in a workflow run. 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.
12+
13+
```js
14+
octokit.actions.getJobForWorkflowRun({
15+
owner,
16+
repo,
17+
job_id,
18+
});
19+
```
20+
21+
## Parameters
22+
23+
<table>
24+
<thead>
25+
<tr>
26+
<th>name</th>
27+
<th>required</th>
28+
<th>description</th>
29+
</tr>
30+
</thead>
31+
<tbody>
32+
<tr><td>owner</td><td>yes</td><td>
33+
34+
</td></tr>
35+
<tr><td>repo</td><td>yes</td><td>
36+
37+
</td></tr>
38+
<tr><td>job_id</td><td>yes</td><td>
39+
40+
</td></tr>
41+
</tbody>
42+
</table>
43+
44+
See also: [GitHub Developer Guide documentation](https://developer.github.com/v3/actions/workflow-jobs/#get-a-job-for-a-workflow-run).

docs/actions/getWorkflowJob.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
---
2-
name: Get a workflow job
2+
name: Get a job for a workflow run
33
example: octokit.actions.getWorkflowJob({ owner, repo, job_id })
44
route: GET /repos/{owner}/{repo}/actions/jobs/{job_id}
55
scope: actions
66
type: API method
77
---
88

9-
# Get a workflow job
9+
# Get a job for a workflow run
10+
11+
**Deprecated:** This method has been renamed to actions.getJobForWorkflowRun
1012

1113
Gets a specific job in a workflow run. 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.
1214

@@ -41,4 +43,4 @@ octokit.actions.getWorkflowJob({
4143
</tbody>
4244
</table>
4345

44-
See also: [GitHub Developer Guide documentation](https://developer.github.com/v3/actions/workflow-jobs/#get-a-workflow-job).
46+
See also: [GitHub Developer Guide documentation](https://developer.github.com/v3/actions/workflow-jobs/#get-a-job-for-a-workflow-run).

docs/actions/listRepoWorkflowRuns.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
---
2-
name: List repository workflow runs
2+
name: List workflow runs for a repository
33
example: octokit.actions.listRepoWorkflowRuns({ owner, repo })
44
route: GET /repos/{owner}/{repo}/actions/runs
55
scope: actions
66
type: API method
77
---
88

9-
# List repository workflow runs
9+
# List workflow runs for a repository
10+
11+
**Deprecated:** This method has been renamed to actions.listWorkflowRunsForRepo
1012

1113
Lists all workflow runs for a repository. You can use parameters to narrow the list of results. For more information about using parameters, see [Parameters](https://developer.github.com/v3/#parameters).
1214

@@ -69,4 +71,4 @@ Page number of the results to fetch.
6971
</tbody>
7072
</table>
7173

72-
See also: [GitHub Developer Guide documentation](https://developer.github.com/v3/actions/workflow-runs/#list-repository-workflow-runs).
74+
See also: [GitHub Developer Guide documentation](https://developer.github.com/v3/actions/workflow-runs/#list-workflow-runs-for-a-repository).

docs/actions/listWorkflowJobLogs.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
---
2-
name: Download workflow job logs
2+
name: Download job logs for a workflow run
33
example: octokit.actions.listWorkflowJobLogs({ owner, repo, job_id })
44
route: GET /repos/{owner}/{repo}/actions/jobs/{job_id}/logs
55
scope: actions
66
type: API method
77
---
88

9-
# Download workflow job logs
9+
# Download job logs for a workflow run
1010

1111
**Deprecated:** This method has been renamed to actions.downloadWorkflowJobLogs
1212

@@ -45,4 +45,4 @@ octokit.actions.listWorkflowJobLogs({
4545
</tbody>
4646
</table>
4747

48-
See also: [GitHub Developer Guide documentation](https://developer.github.com/v3/actions/workflow-jobs/#download-workflow-job-logs).
48+
See also: [GitHub Developer Guide documentation](https://developer.github.com/v3/actions/workflow-jobs/#download-job-logs-for-a-workflow-run).
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
---
2+
name: List workflow runs for a repository
3+
example: octokit.actions.listWorkflowRunsForRepo({ owner, repo })
4+
route: GET /repos/{owner}/{repo}/actions/runs
5+
scope: actions
6+
type: API method
7+
---
8+
9+
# List workflow runs for a repository
10+
11+
Lists all workflow runs for a repository. You can use parameters to narrow the list of results. For more information about using parameters, see [Parameters](https://developer.github.com/v3/#parameters).
12+
13+
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.
14+
15+
```js
16+
octokit.actions.listWorkflowRunsForRepo({
17+
owner,
18+
repo,
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>actor</td><td>no</td><td>
40+
41+
Returns someone's workflow runs. Use the login for the user who created the `push` associated with the check suite or workflow run.
42+
43+
</td></tr>
44+
<tr><td>branch</td><td>no</td><td>
45+
46+
Returns workflow runs associated with a branch. Use the name of the branch of the `push`.
47+
48+
</td></tr>
49+
<tr><td>event</td><td>no</td><td>
50+
51+
Returns workflow run triggered by the event you specify. For example, `push`, `pull_request` or `issue`. For more information, see "[Events that trigger workflows](https://help.github.com/en/actions/automating-your-workflow-with-github-actions/events-that-trigger-workflows)" in the GitHub Help documentation.
52+
53+
</td></tr>
54+
<tr><td>status</td><td>no</td><td>
55+
56+
Returns workflow runs associated with the check run `status` or `conclusion` you specify. For example, a conclusion can be `success` or a status can be `completed`. For more information, see the `status` and `conclusion` options available in "[Create a check run](https://developer.github.com/v3/checks/runs/#create-a-check-run)."
57+
58+
</td></tr>
59+
<tr><td>per_page</td><td>no</td><td>
60+
61+
Results per page (max 100)
62+
63+
</td></tr>
64+
<tr><td>page</td><td>no</td><td>
65+
66+
Page number of the results to fetch.
67+
68+
</td></tr>
69+
</tbody>
70+
</table>
71+
72+
See also: [GitHub Developer Guide documentation](https://developer.github.com/v3/actions/workflow-runs/#list-workflow-runs-for-a-repository).

docs/apps/addRepoToInstallation.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
---
2-
name: Add repository to installation
2+
name: Add a repository to an app installation
33
example: octokit.apps.addRepoToInstallation({ installation_id, repository_id })
44
route: PUT /user/installations/{installation_id}/repositories/{repository_id}
55
scope: apps
66
type: API method
77
---
88

9-
# Add repository to installation
9+
# Add a repository to an app installation
1010

1111
Add a single repository to an installation. The authenticated user must have admin access to the repository.
1212

@@ -39,4 +39,4 @@ octokit.apps.addRepoToInstallation({
3939
</tbody>
4040
</table>
4141

42-
See also: [GitHub Developer Guide documentation](https://developer.github.com/v3/apps/installations/#add-repository-to-installation).
42+
See also: [GitHub Developer Guide documentation](https://developer.github.com/v3/apps/installations/#add-a-repository-to-an-app-installation).
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
---
2+
name: Create an installation access token for an app
3+
example: octokit.apps.createInstallationAccessToken({ installation_id })
4+
route: POST /app/installations/{installation_id}/access_tokens
5+
scope: apps
6+
type: API method
7+
---
8+
9+
# Create an installation access token for an app
10+
11+
Creates an installation access token that enables a GitHub App to make authenticated API requests for the app's installation on an organization or individual account. Installation tokens expire one hour from the time you create them. Using an expired token produces a status code of `401 - Unauthorized`, and requires creating a new installation token. By default the installation token has access to all repositories that the installation can access. To restrict the access to specific repositories, you can provide the `repository_ids` when creating the token. When you omit `repository_ids`, the response does not contain the `repositories` key.
12+
13+
You must use a [JWT](https://developer.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint.
14+
15+
This example grants the token "Read and write" permission to `issues` and "Read" permission to `contents`, and restricts the token's access to the repository with an `id` of 1296269.
16+
17+
```js
18+
octokit.apps.createInstallationAccessToken({
19+
installation_id,
20+
});
21+
```
22+
23+
## Parameters
24+
25+
<table>
26+
<thead>
27+
<tr>
28+
<th>name</th>
29+
<th>required</th>
30+
<th>description</th>
31+
</tr>
32+
</thead>
33+
<tbody>
34+
<tr><td>installation_id</td><td>yes</td><td>
35+
36+
</td></tr>
37+
<tr><td>repository_ids</td><td>no</td><td>
38+
39+
The `id`s of the repositories that the installation token can access. Providing repository `id`s restricts the access of an installation token to specific repositories. You can use the "[List repositories accessible to the app installation](https://developer.github.com/v3/apps/installations/#list-repositories-accessible-to-the-app-installation)" endpoint to get the `id` of all repositories that an installation can access. For example, you can select specific repositories when creating an installation token to restrict the number of repositories that can be cloned using the token.
40+
41+
</td></tr>
42+
<tr><td>permissions</td><td>no</td><td>
43+
44+
The permissions granted to the access token. The permissions object includes the permission names and their access type. For a complete list of permissions and allowable values, see "[GitHub App permissions](https://developer.github.com/apps/building-github-apps/creating-github-apps-using-url-parameters/#github-app-permissions)."
45+
46+
</td></tr>
47+
</tbody>
48+
</table>
49+
50+
See also: [GitHub Developer Guide documentation](https://developer.github.com/v3/apps/#create-an-installation-access-token-for-an-app).

docs/apps/createInstallationToken.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
---
2-
name: Create a new installation token
2+
name: Create an installation access token for an app
33
example: octokit.apps.createInstallationToken({ installation_id })
44
route: POST /app/installations/{installation_id}/access_tokens
55
scope: apps
66
type: API method
77
---
88

9-
# Create a new installation token
9+
# Create an installation access token for an app
10+
11+
**Deprecated:** This method has been renamed to apps.createInstallationAccessToken
1012

1113
Creates an installation access token that enables a GitHub App to make authenticated API requests for the app's installation on an organization or individual account. Installation tokens expire one hour from the time you create them. Using an expired token produces a status code of `401 - Unauthorized`, and requires creating a new installation token. By default the installation token has access to all repositories that the installation can access. To restrict the access to specific repositories, you can provide the `repository_ids` when creating the token. When you omit `repository_ids`, the response does not contain the `repositories` key.
1214

@@ -36,7 +38,7 @@ octokit.apps.createInstallationToken({
3638
</td></tr>
3739
<tr><td>repository_ids</td><td>no</td><td>
3840

39-
The `id`s of the repositories that the installation token can access. Providing repository `id`s restricts the access of an installation token to specific repositories. You can use the "[List repositories](https://developer.github.com/v3/apps/installations/#list-repositories)" endpoint to get the `id` of all repositories that an installation can access. For example, you can select specific repositories when creating an installation token to restrict the number of repositories that can be cloned using the token.
41+
The `id`s of the repositories that the installation token can access. Providing repository `id`s restricts the access of an installation token to specific repositories. You can use the "[List repositories accessible to the app installation](https://developer.github.com/v3/apps/installations/#list-repositories-accessible-to-the-app-installation)" endpoint to get the `id` of all repositories that an installation can access. For example, you can select specific repositories when creating an installation token to restrict the number of repositories that can be cloned using the token.
4042

4143
</td></tr>
4244
<tr><td>permissions</td><td>no</td><td>
@@ -47,4 +49,4 @@ The permissions granted to the access token. The permissions object includes the
4749
</tbody>
4850
</table>
4951

50-
See also: [GitHub Developer Guide documentation](https://developer.github.com/v3/apps/#create-a-new-installation-token).
52+
See also: [GitHub Developer Guide documentation](https://developer.github.com/v3/apps/#create-an-installation-access-token-for-an-app).

0 commit comments

Comments
 (0)