Skip to content

Commit d245c54

Browse files
feat: organization secrets endpoint methods (#85)
Co-authored-by: Octokit Bot <33075676+octokitbot@users.noreply.github.com>
1 parent b3811a1 commit d245c54

File tree

74 files changed

+2911
-704
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

74 files changed

+2911
-704
lines changed
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
---
2+
name: Add selected repository to an organization secret
3+
example: octokit.actions.addSelectedRepoToOrgSecret({ org, secret_name, repository_id })
4+
route: PUT /orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}
5+
scope: actions
6+
type: API method
7+
---
8+
9+
# Add selected repository to an organization secret
10+
11+
Adds a repository to an organization secret when the `visibility` for repository access is set to `selected`. The visibility is set when you [Create or update an organization secret](https://developer.github.com/v3/actions/secrets/#create-or-update-an-organization-secret). 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.
12+
13+
```js
14+
octokit.actions.addSelectedRepoToOrgSecret({
15+
org,
16+
secret_name,
17+
repository_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>org</td><td>yes</td><td>
33+
34+
</td></tr>
35+
<tr><td>secret_name</td><td>yes</td><td>
36+
37+
</td></tr>
38+
<tr><td>repository_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/secrets/#add-selected-repository-to-an-organization-secret).

docs/actions/cancelWorkflowRun.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ type: API method
88

99
# Cancel a workflow run
1010

11-
Cancels a workflow run using its `id`. Anyone with write access to the repository and an access token with the `repo` scope can use this endpoint. GitHub Apps must have the `actions` permission to use this endpoint.
11+
Cancels a workflow run using its `id`. You must authenticate using an access token with the `repo` scope to use this endpoint. GitHub Apps must have the `actions:write` permission to use this endpoint.
1212

1313
```js
1414
octokit.actions.cancelWorkflowRun({
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
---
2+
name: Create or update an organization secret
3+
example: octokit.actions.createOrUpdateOrgSecret({ org, secret_name })
4+
route: PUT /orgs/{org}/actions/secrets/{secret_name}
5+
scope: actions
6+
type: API method
7+
---
8+
9+
# Create or update an organization secret
10+
11+
Creates or updates an organization secret with an encrypted value. Encrypt your secret using [LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages). 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.
12+
13+
Encrypt your secret using the [tweetsodium](https://github.com/github/tweetsodium) library.
14+
15+
Encrypt your secret using [pynacl](https://pynacl.readthedocs.io/en/stable/public/#nacl-public-sealedbox) with Python 3.
16+
17+
Encrypt your secret using the [Sodium.Core](https://www.nuget.org/packages/Sodium.Core/) package.
18+
19+
Encrypt your secret using the [rbnacl](https://github.com/RubyCrypto/rbnacl) gem.
20+
21+
```js
22+
octokit.actions.createOrUpdateOrgSecret({
23+
org,
24+
secret_name,
25+
});
26+
```
27+
28+
## Parameters
29+
30+
<table>
31+
<thead>
32+
<tr>
33+
<th>name</th>
34+
<th>required</th>
35+
<th>description</th>
36+
</tr>
37+
</thead>
38+
<tbody>
39+
<tr><td>org</td><td>yes</td><td>
40+
41+
</td></tr>
42+
<tr><td>secret_name</td><td>yes</td><td>
43+
44+
</td></tr>
45+
<tr><td>encrypted_value</td><td>no</td><td>
46+
47+
Value for your secret, encrypted with [LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages) using the public key retrieved from the [Get an organization public key](https://developer.github.com/v3/actions/secrets/#get-an-organization-public-key) endpoint.
48+
49+
</td></tr>
50+
<tr><td>key_id</td><td>no</td><td>
51+
52+
ID of the key you used to encrypt the secret.
53+
54+
</td></tr>
55+
<tr><td>visibility</td><td>no</td><td>
56+
57+
Configures the access that repositories have to the organization secret. Can be one of:
58+
\- `all` - All repositories in an organization can access the secret.
59+
\- `private` - Private repositories in an organization can access the secret.
60+
\- `selected` - Only specific repositories can access the secret.
61+
62+
</td></tr>
63+
<tr><td>selected_repository_ids</td><td>no</td><td>
64+
65+
An array of repository ids that can access the organization secret. You can only provide a list of repository ids when the `visibility` is set to `selected`. You can manage the list of selected repositories using the [List selected repositories for an organization secret](https://developer.github.com/v3/actions/secrets/#list-selected-repositories-for-an-organization-secret), [Set selected repositories for an organization secret](https://developer.github.com/v3/actions/secrets/#set-selected-repositories-for-an-organization-secret), and [Remove selected repository from an organization secret](https://developer.github.com/v3/actions/secrets/#remove-selected-repository-from-an-organization-secret) endpoints.
66+
67+
</td></tr>
68+
</tbody>
69+
</table>
70+
71+
See also: [GitHub Developer Guide documentation](https://developer.github.com/v3/actions/secrets/#create-or-update-an-organization-secret).
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
---
2+
name: Create or update a repository secret
3+
example: octokit.actions.createOrUpdateRepoSecret({ owner, repo, secret_name })
4+
route: PUT /repos/{owner}/{repo}/actions/secrets/{secret_name}
5+
scope: actions
6+
type: API method
7+
---
8+
9+
# Create or update a repository secret
10+
11+
Creates or updates a repository secret with an encrypted value. Encrypt your secret using [LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages). You must authenticate using an access token with the `repo` scope to use this endpoint. GitHub Apps must have the `secrets` repository permission to use this endpoint.
12+
13+
Encrypt your secret using the [tweetsodium](https://github.com/github/tweetsodium) library.
14+
15+
Encrypt your secret using [pynacl](https://pynacl.readthedocs.io/en/stable/public/#nacl-public-sealedbox) with Python 3.
16+
17+
Encrypt your secret using the [Sodium.Core](https://www.nuget.org/packages/Sodium.Core/) package.
18+
19+
Encrypt your secret using the [rbnacl](https://github.com/RubyCrypto/rbnacl) gem.
20+
21+
```js
22+
octokit.actions.createOrUpdateRepoSecret({
23+
owner,
24+
repo,
25+
secret_name,
26+
});
27+
```
28+
29+
## Parameters
30+
31+
<table>
32+
<thead>
33+
<tr>
34+
<th>name</th>
35+
<th>required</th>
36+
<th>description</th>
37+
</tr>
38+
</thead>
39+
<tbody>
40+
<tr><td>owner</td><td>yes</td><td>
41+
42+
</td></tr>
43+
<tr><td>repo</td><td>yes</td><td>
44+
45+
</td></tr>
46+
<tr><td>secret_name</td><td>yes</td><td>
47+
48+
</td></tr>
49+
<tr><td>encrypted_value</td><td>no</td><td>
50+
51+
Value for your secret, encrypted with [LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages) using the public key retrieved from the [Get a repository public key](https://developer.github.com/v3/actions/secrets/#get-a-repository-public-key) endpoint.
52+
53+
</td></tr>
54+
<tr><td>key_id</td><td>no</td><td>
55+
56+
ID of the key you used to encrypt the secret.
57+
58+
</td></tr>
59+
<tr><td>name</td><td>no</td><td>
60+
61+
</td></tr>
62+
</tbody>
63+
</table>
64+
65+
See also: [GitHub Developer Guide documentation](https://developer.github.com/v3/actions/secrets/#create-or-update-a-repository-secret).
Lines changed: 10 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,22 @@
11
---
2-
name: Create or update a secret for a repository
3-
example: octokit.actions.createOrUpdateSecretForRepo({ owner, repo, name })
4-
route: PUT /repos/{owner}/{repo}/actions/secrets/{name}
2+
name: Delete a repository secret
3+
example: octokit.actions.createOrUpdateSecretForRepo({ owner, repo, secret_name })
4+
route: DELETE /repos/{owner}/{repo}/actions/secrets/{secret_name}
55
scope: actions
66
type: API method
77
---
88

9-
# Create or update a secret for a repository
9+
# Delete a repository secret
1010

11-
Creates or updates a secret with an encrypted value. Encrypt your secret using [LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages). Anyone with write access to the repository and an access token with the `repo` scope can use this endpoint. GitHub Apps must have the `secrets` permission to use this endpoint.
11+
**Deprecated:** This method has been renamed to actions.createOrUpdateRepoSecret
1212

13-
Encrypt your secret using the [tweetsodium](https://github.com/mastahyeti/tweetsodium) library.
14-
15-
Encrypt your secret using [pynacl](https://pynacl.readthedocs.io/en/stable/public/#nacl-public-sealedbox) with Python 3.
16-
17-
Encrypt your secret using the [Sodium.Core](https://www.nuget.org/packages/Sodium.Core/) package.
18-
19-
Encrypt your secret using the [rbnacl](https://github.com/RubyCrypto/rbnacl) gem.
13+
Deletes a secret in a repository using the secret name. You must authenticate using an access token with the `repo` scope to use this endpoint. GitHub Apps must have the `secrets` repository permission to use this endpoint.
2014

2115
```js
2216
octokit.actions.createOrUpdateSecretForRepo({
2317
owner,
2418
repo,
25-
name,
19+
secret_name,
2620
});
2721
```
2822

@@ -43,20 +37,13 @@ octokit.actions.createOrUpdateSecretForRepo({
4337
<tr><td>repo</td><td>yes</td><td>
4438

4539
</td></tr>
46-
<tr><td>name</td><td>yes</td><td>
40+
<tr><td>secret_name</td><td>yes</td><td>
4741

4842
</td></tr>
49-
<tr><td>encrypted_value</td><td>no</td><td>
50-
51-
Value for your secret, encrypted with [LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages) using the public key retrieved from the [Get your public key](https://developer.github.com/v3/actions/secrets/#get-your-public-key) endpoint.
52-
53-
</td></tr>
54-
<tr><td>key_id</td><td>no</td><td>
55-
56-
ID of the key you used to encrypt the secret.
43+
<tr><td>name</td><td>no</td><td>
5744

5845
</td></tr>
5946
</tbody>
6047
</table>
6148

62-
See also: [GitHub Developer Guide documentation](https://developer.github.com/v3/actions/secrets/#create-or-update-a-secret-for-a-repository).
49+
See also: [GitHub Developer Guide documentation](https://developer.github.com/v3/actions/secrets/#delete-a-repository-secret).

docs/actions/createRegistrationToken.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ type: API method
1010

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

13-
Returns a token that you can pass to the `config` script. The token expires after one hour. Anyone with admin access to the repository and an access token with the `repo` scope can use this endpoint.
13+
Returns a token that you can pass to the `config` script. The token expires after one hour. You must authenticate using an access token with the `repo` scope to use this endpoint.
1414

1515
Configure your self-hosted runner, replacing TOKEN with the registration token provided by this endpoint.
1616

docs/actions/createRegistrationTokenForOrg.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ type: API method
1010

1111
**Warning:** The self-hosted runners API for organizations is currently in public beta and subject to change.
1212

13-
Returns a token that you can pass to the `config` script. The token expires after one hour. Anyone with admin access to the organization can use this endpoint.
13+
Returns a token that you can pass to the `config` script. The token expires after one hour. You must authenticate using an access token with the `admin:org` scope to use this endpoint.
1414

1515
Configure your self-hosted runner, replacing `TOKEN` with the registration token provided by this endpoint.
1616

docs/actions/createRegistrationTokenForRepo.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ type: API method
88

99
# Create a registration token for a repository
1010

11-
Returns a token that you can pass to the `config` script. The token expires after one hour. Anyone with admin access to the repository and an access token with the `repo` scope can use this endpoint.
11+
Returns a token that you can pass to the `config` script. The token expires after one hour. You must authenticate using an access token with the `repo` scope to use this endpoint.
1212

1313
Configure your self-hosted runner, replacing TOKEN with the registration token provided by this endpoint.
1414

docs/actions/createRemoveToken.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ type: API method
1010

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

13-
Returns a token that you can pass to remove a self-hosted runner from a repository. The token expires after one hour. Anyone with admin access to the repository and an access token with the `repo` scope can use this endpoint.
13+
Returns a token that you can pass to remove a self-hosted runner from a repository. The token expires after one hour. You must authenticate using an access token with the `repo` scope to use this endpoint.
1414

1515
Remove your self-hosted runner from a repository, replacing TOKEN with the remove token provided by this endpoint.
1616

docs/actions/createRemoveTokenForOrg.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ type: API method
1010

1111
**Warning:** The self-hosted runners API for organizations is currently in public beta and subject to change.
1212

13-
Returns a token that you can pass to the `config` script to remove a self-hosted runner from an organization. The token expires after one hour. Anyone with admin access to the organization can use this endpoint.
13+
Returns a token that you can pass to the `config` script to remove a self-hosted runner from an organization. The token expires after one hour. You must authenticate using an access token with the `admin:org` scope to use this endpoint.
1414

1515
To remove your self-hosted runner from an organization, replace `TOKEN` with the remove token provided by this endpoint.
1616

0 commit comments

Comments
 (0)