Skip to content

Commit 73e91b2

Browse files
authored
feat: remove required workflow endpoint methods, new copilot endpoint methods, new repos.checkAutomatedSecurityFixes({ owner, repo }), repos.disablePrivateVulnerabilityReporting({ owner, repo }), repos.enablePrivateVulnerabilityReporting({ owner, repo }), repos.listActivities({ owner, repo }), security advisories methods (octokit#679)
BREAKING CHANGE: remove required workflow endpoint methods
1 parent 70fc61e commit 73e91b2

File tree

775 files changed

+7550
-6973
lines changed

Some content is hidden

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

775 files changed

+7550
-6973
lines changed

docs/actions/addCustomLabelsToSelfHostedRunnerForOrg.md

+4-1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ type: API method
1111
Add custom labels to a self-hosted runner configured in an organization.
1212

1313
You must authenticate using an access token with the `admin:org` scope to use this endpoint.
14+
If the repository is private, you must use an access token with the `repo` scope.
15+
GitHub Apps must have the `administration` permission for repositories and the `organization_self_hosted_runners` permission for organizations.
16+
Authenticated users must have admin access to repositories or organizations, or the `manage_runners:enterprise` scope for enterprises, to use these endpoints.
1417

1518
```js
1619
octokit.rest.actions.addCustomLabelsToSelfHostedRunnerForOrg({
@@ -49,4 +52,4 @@ The names of the custom labels to add to the runner.
4952
</tbody>
5053
</table>
5154

52-
See also: [GitHub Developer Guide documentation](https://docs.github.com/rest/reference/actions#add-custom-labels-to-a-self-hosted-runner-for-an-organization).
55+
See also: [GitHub Developer Guide documentation](https://docs.github.com/rest/actions/self-hosted-runners#add-custom-labels-to-a-self-hosted-runner-for-an-organization).

docs/actions/addCustomLabelsToSelfHostedRunnerForRepo.md

+5-3
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,10 @@ type: API method
1010

1111
Add custom labels to a self-hosted runner configured in a repository.
1212

13-
You must authenticate using an access token with the `repo` scope to use this
14-
endpoint.
13+
You must authenticate using an access token with the `repo` scope to use this endpoint.
14+
If the repository is private, you must use an access token with the `repo` scope.
15+
GitHub Apps must have the `administration` permission for repositories and the `organization_self_hosted_runners` permission for organizations.
16+
Authenticated users must have admin access to repositories or organizations, or the `manage_runners:enterprise` scope for enterprises, to use these endpoints.
1517

1618
```js
1719
octokit.rest.actions.addCustomLabelsToSelfHostedRunnerForRepo({
@@ -56,4 +58,4 @@ The names of the custom labels to add to the runner.
5658
</tbody>
5759
</table>
5860

59-
See also: [GitHub Developer Guide documentation](https://docs.github.com/rest/reference/actions#add-custom-labels-to-a-self-hosted-runner-for-a-repository).
61+
See also: [GitHub Developer Guide documentation](https://docs.github.com/rest/actions/self-hosted-runners#add-custom-labels-to-a-self-hosted-runner-for-a-repository).

docs/actions/addSelectedRepoToOrgSecret.md

+9-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,14 @@ type: API method
88

99
# Add selected repository to an organization secret
1010

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://docs.github.com/rest/reference/actions#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.
11+
Adds a repository to an organization secret when the `visibility` for
12+
repository access is set to `selected`. The visibility is set when you [Create or
13+
update an organization secret](https://docs.github.com/rest/actions/secrets#create-or-update-an-organization-secret).
14+
15+
You must authenticate using an access token with the `admin:org` scope to use this endpoint.
16+
If the repository is private, you must use an access token with the `repo` scope.
17+
GitHub Apps must have the `secrets` organization permission to use this endpoint.
18+
Authenticated users must have collaborator access to a repository to create, update, or read secrets.
1219

1320
```js
1421
octokit.rest.actions.addSelectedRepoToOrgSecret({
@@ -45,4 +52,4 @@ The name of the secret.
4552
</tbody>
4653
</table>
4754

48-
See also: [GitHub Developer Guide documentation](https://docs.github.com/rest/reference/actions#add-selected-repository-to-an-organization-secret).
55+
See also: [GitHub Developer Guide documentation](https://docs.github.com/rest/actions/secrets#add-selected-repository-to-an-organization-secret).

docs/actions/addSelectedRepoToOrgVariable.md

+7-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,13 @@ type: API method
88

99
# Add selected repository to an organization variable
1010

11-
Adds a repository to an organization variable that is available to selected repositories. Organization variables that are available to selected repositories have their `visibility` field set to `selected`. You must authenticate using an access token with the `admin:org` scope to use this endpoint. GitHub Apps must have the `organization_actions_variables:write` organization permission to use this endpoint.
11+
Adds a repository to an organization variable that is available to selected repositories.
12+
Organization variables that are available to selected repositories have their `visibility` field set to `selected`.
13+
14+
You must authenticate using an access token with the `admin:org` scope to use this endpoint.
15+
If the repository is private, you must use an access token with the `repo` scope.
16+
GitHub Apps must have the `organization_actions_variables:write` organization permission to use this endpoint.
17+
Authenticated users must have collaborator access to a repository to create, update, or read variables.
1218

1319
```js
1420
octokit.rest.actions.addSelectedRepoToOrgVariable({

docs/actions/addSelectedRepoToRequiredWorkflow.md

-54
This file was deleted.

docs/actions/approveWorkflowRun.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,4 +49,4 @@ The unique identifier of the workflow run.
4949
</tbody>
5050
</table>
5151

52-
See also: [GitHub Developer Guide documentation](https://docs.github.com/rest/reference/actions#approve-a-workflow-run-for-a-fork-pull-request).
52+
See also: [GitHub Developer Guide documentation](https://docs.github.com/rest/actions/workflow-runs#approve-a-workflow-run-for-a-fork-pull-request).

docs/actions/cancelWorkflowRun.md

+6-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,11 @@ type: API method
88

99
# Cancel a workflow run
1010

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.
11+
Cancels a workflow run using its `id`.
12+
13+
You must authenticate using an access token with the `repo` scope to use this endpoint.
14+
If the repository is private, you must use an access token with the `repo` scope.
15+
GitHub Apps must have the `actions:write` permission to use this endpoint.
1216

1317
```js
1418
octokit.rest.actions.cancelWorkflowRun({
@@ -47,4 +51,4 @@ The unique identifier of the workflow run.
4751
</tbody>
4852
</table>
4953

50-
See also: [GitHub Developer Guide documentation](https://docs.github.com/rest/reference/actions#cancel-a-workflow-run).
54+
See also: [GitHub Developer Guide documentation](https://docs.github.com/rest/actions/workflow-runs#cancel-a-workflow-run).

docs/actions/createEnvironmentVariable.md

+3
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,11 @@ type: API method
99
# Create an environment variable
1010

1111
Create an environment variable that you can reference in a GitHub Actions workflow.
12+
1213
You must authenticate using an access token with the `repo` scope to use this endpoint.
14+
If the repository is private, you must use an access token with the `repo` scope.
1315
GitHub Apps must have the `environment:write` repository permission to use this endpoint.
16+
Authenticated users must have collaborator access to a repository to create, update, or read variables.
1417

1518
```js
1619
octokit.rest.actions.createEnvironmentVariable({

docs/actions/createOrUpdateEnvironmentSecret.md

+6-76
Original file line numberDiff line numberDiff line change
@@ -9,81 +9,11 @@ type: API method
99
# Create or update an environment secret
1010

1111
Creates or updates an environment secret with an encrypted value. Encrypt your secret using
12-
[LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages). You must authenticate using an access
13-
token with the `repo` scope to use this endpoint. GitHub Apps must have the `secrets` repository permission to use
14-
this endpoint.
12+
[LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages). For more information, see "[Encrypting secrets for the REST API](https://docs.github.com/rest/guides/encrypting-secrets-for-the-rest-api)."
1513

16-
**Example encrypting a secret using Node.js**
17-
18-
Encrypt your secret using the [libsodium-wrappers](https://www.npmjs.com/package/libsodium-wrappers) library.
19-
20-
```
21-
const sodium = require('libsodium-wrappers')
22-
const secret = 'plain-text-secret' // replace with the secret you want to encrypt
23-
const key = 'base64-encoded-public-key' // replace with the Base64 encoded public key
24-
25-
//Check if libsodium is ready and then proceed.
26-
sodium.ready.then(() => {
27-
// Convert Secret & Base64 key to Uint8Array.
28-
let binkey = sodium.from_base64(key, sodium.base64_variants.ORIGINAL)
29-
let binsec = sodium.from_string(secret)
30-
31-
//Encrypt the secret using LibSodium
32-
let encBytes = sodium.crypto_box_seal(binsec, binkey)
33-
34-
// Convert encrypted Uint8Array to Base64
35-
let output = sodium.to_base64(encBytes, sodium.base64_variants.ORIGINAL)
36-
37-
console.log(output)
38-
});
39-
```
40-
41-
**Example encrypting a secret using Python**
42-
43-
Encrypt your secret using [pynacl](https://pynacl.readthedocs.io/en/latest/public/#nacl-public-sealedbox) with Python 3.
44-
45-
```
46-
from base64 import b64encode
47-
from nacl import encoding, public
48-
49-
def encrypt(public_key: str, secret_value: str) -> str:
50-
"""Encrypt a Unicode string using the public key."""
51-
public_key = public.PublicKey(public_key.encode("utf-8"), encoding.Base64Encoder())
52-
sealed_box = public.SealedBox(public_key)
53-
encrypted = sealed_box.encrypt(secret_value.encode("utf-8"))
54-
return b64encode(encrypted).decode("utf-8")
55-
```
56-
57-
**Example encrypting a secret using C#**
58-
59-
Encrypt your secret using the [Sodium.Core](https://www.nuget.org/packages/Sodium.Core/) package.
60-
61-
```
62-
var secretValue = System.Text.Encoding.UTF8.GetBytes("mySecret");
63-
var publicKey = Convert.FromBase64String("2Sg8iYjAxxmI2LvUXpJjkYrMxURPc8r+dB7TJyvvcCU=");
64-
65-
var sealedPublicKeyBox = Sodium.SealedPublicKeyBox.Create(secretValue, publicKey);
66-
67-
Console.WriteLine(Convert.ToBase64String(sealedPublicKeyBox));
68-
```
69-
70-
**Example encrypting a secret using Ruby**
71-
72-
Encrypt your secret using the [rbnacl](https://github.com/RubyCrypto/rbnacl) gem.
73-
74-
```ruby
75-
require "rbnacl"
76-
require "base64"
77-
78-
key = Base64.decode64("+ZYvJDZMHUfBkJdyq5Zm9SKqeuBQ4sj+6sfjlH4CgG0=")
79-
public_key = RbNaCl::PublicKey.new(key)
80-
81-
box = RbNaCl::Boxes::Sealed.from_public_key(public_key)
82-
encrypted_secret = box.encrypt("my_secret")
83-
84-
# Print the base64 encoded secret
85-
puts Base64.strict_encode64(encrypted_secret)
86-
```
14+
You must authenticate using an access token with the `repo` scope to use this endpoint.
15+
GitHub Apps must have the `secrets` repository permission to use this endpoint.
16+
Authenticated users must have collaborator access to a repository to create, update, or read secrets.
8717

8818
```js
8919
octokit.rest.actions.createOrUpdateEnvironmentSecret({
@@ -123,7 +53,7 @@ The name of the secret.
12353
</td></tr>
12454
<tr><td>encrypted_value</td><td>yes</td><td>
12555

126-
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 environment public key](https://docs.github.com/rest/reference/actions#get-an-environment-public-key) endpoint.
56+
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 environment public key](https://docs.github.com/rest/actions/secrets#get-an-environment-public-key) endpoint.
12757

12858
</td></tr>
12959
<tr><td>key_id</td><td>yes</td><td>
@@ -134,4 +64,4 @@ ID of the key you used to encrypt the secret.
13464
</tbody>
13565
</table>
13666

137-
See also: [GitHub Developer Guide documentation](https://docs.github.com/rest/reference/actions#create-or-update-an-environment-secret).
67+
See also: [GitHub Developer Guide documentation](https://docs.github.com/rest/actions/secrets#create-or-update-an-environment-secret).

docs/actions/createOrUpdateRepoSecret.md

+6-76
Original file line numberDiff line numberDiff line change
@@ -9,81 +9,11 @@ type: API method
99
# Create or update a repository secret
1010

1111
Creates or updates a repository secret with an encrypted value. Encrypt your secret using
12-
[LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages). You must authenticate using an access
13-
token with the `repo` scope to use this endpoint. GitHub Apps must have the `secrets` repository permission to use
14-
this endpoint.
12+
[LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages). For more information, see "[Encrypting secrets for the REST API](https://docs.github.com/rest/guides/encrypting-secrets-for-the-rest-api)."
1513

16-
**Example encrypting a secret using Node.js**
17-
18-
Encrypt your secret using the [libsodium-wrappers](https://www.npmjs.com/package/libsodium-wrappers) library.
19-
20-
```
21-
const sodium = require('libsodium-wrappers')
22-
const secret = 'plain-text-secret' // replace with the secret you want to encrypt
23-
const key = 'base64-encoded-public-key' // replace with the Base64 encoded public key
24-
25-
//Check if libsodium is ready and then proceed.
26-
sodium.ready.then(() => {
27-
// Convert Secret & Base64 key to Uint8Array.
28-
let binkey = sodium.from_base64(key, sodium.base64_variants.ORIGINAL)
29-
let binsec = sodium.from_string(secret)
30-
31-
//Encrypt the secret using LibSodium
32-
let encBytes = sodium.crypto_box_seal(binsec, binkey)
33-
34-
// Convert encrypted Uint8Array to Base64
35-
let output = sodium.to_base64(encBytes, sodium.base64_variants.ORIGINAL)
36-
37-
console.log(output)
38-
});
39-
```
40-
41-
**Example encrypting a secret using Python**
42-
43-
Encrypt your secret using [pynacl](https://pynacl.readthedocs.io/en/latest/public/#nacl-public-sealedbox) with Python 3.
44-
45-
```
46-
from base64 import b64encode
47-
from nacl import encoding, public
48-
49-
def encrypt(public_key: str, secret_value: str) -> str:
50-
"""Encrypt a Unicode string using the public key."""
51-
public_key = public.PublicKey(public_key.encode("utf-8"), encoding.Base64Encoder())
52-
sealed_box = public.SealedBox(public_key)
53-
encrypted = sealed_box.encrypt(secret_value.encode("utf-8"))
54-
return b64encode(encrypted).decode("utf-8")
55-
```
56-
57-
**Example encrypting a secret using C#**
58-
59-
Encrypt your secret using the [Sodium.Core](https://www.nuget.org/packages/Sodium.Core/) package.
60-
61-
```
62-
var secretValue = System.Text.Encoding.UTF8.GetBytes("mySecret");
63-
var publicKey = Convert.FromBase64String("2Sg8iYjAxxmI2LvUXpJjkYrMxURPc8r+dB7TJyvvcCU=");
64-
65-
var sealedPublicKeyBox = Sodium.SealedPublicKeyBox.Create(secretValue, publicKey);
66-
67-
Console.WriteLine(Convert.ToBase64String(sealedPublicKeyBox));
68-
```
69-
70-
**Example encrypting a secret using Ruby**
71-
72-
Encrypt your secret using the [rbnacl](https://github.com/RubyCrypto/rbnacl) gem.
73-
74-
```ruby
75-
require "rbnacl"
76-
require "base64"
77-
78-
key = Base64.decode64("+ZYvJDZMHUfBkJdyq5Zm9SKqeuBQ4sj+6sfjlH4CgG0=")
79-
public_key = RbNaCl::PublicKey.new(key)
80-
81-
box = RbNaCl::Boxes::Sealed.from_public_key(public_key)
82-
encrypted_secret = box.encrypt("my_secret")
83-
84-
# Print the base64 encoded secret
85-
puts Base64.strict_encode64(encrypted_secret)
86-
```
14+
You must authenticate using an access token with the `repo` scope to use this endpoint.
15+
GitHub Apps must have the `secrets` repository permission to use this endpoint.
16+
Authenticated users must have collaborator access to a repository to create, update, or read secrets.
8717

8818
```js
8919
octokit.rest.actions.createOrUpdateRepoSecret({
@@ -121,7 +51,7 @@ The name of the secret.
12151
</td></tr>
12252
<tr><td>encrypted_value</td><td>no</td><td>
12353

124-
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://docs.github.com/rest/reference/actions#get-a-repository-public-key) endpoint.
54+
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://docs.github.com/rest/actions/secrets#get-a-repository-public-key) endpoint.
12555

12656
</td></tr>
12757
<tr><td>key_id</td><td>no</td><td>
@@ -132,4 +62,4 @@ ID of the key you used to encrypt the secret.
13262
</tbody>
13363
</table>
13464

135-
See also: [GitHub Developer Guide documentation](https://docs.github.com/rest/reference/actions#create-or-update-a-repository-secret).
65+
See also: [GitHub Developer Guide documentation](https://docs.github.com/rest/actions/secrets#create-or-update-a-repository-secret).

docs/actions/createOrgVariable.md

+3
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,11 @@ type: API method
99
# Create an organization variable
1010

1111
Creates an organization variable that you can reference in a GitHub Actions workflow.
12+
1213
You must authenticate using an access token with the `admin:org` scope to use this endpoint.
14+
If the repository is private, you must use an access token with the `repo` scope.
1315
GitHub Apps must have the `organization_actions_variables:write` organization permission to use this endpoint.
16+
Authenticated users must have collaborator access to a repository to create, update, or read variables.
1417

1518
```js
1619
octokit.rest.actions.createOrgVariable({

docs/actions/createRegistrationTokenForOrg.md

+5-2
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,11 @@ type: API method
1111
Returns a token that you can pass to the `config` script. The token expires after one hour.
1212

1313
You must authenticate using an access token with the `admin:org` scope to use this endpoint.
14+
If the repository is private, you must use an access token with the `repo` scope.
15+
GitHub Apps must have the `administration` permission for repositories and the `organization_self_hosted_runners` permission for organizations.
16+
Authenticated users must have admin access to repositories or organizations, or the `manage_runners:enterprise` scope for enterprises, to use these endpoints.
1417

15-
#### Example using registration token
18+
Example using registration token:
1619

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

@@ -45,4 +48,4 @@ The organization name. The name is not case sensitive.
4548
</tbody>
4649
</table>
4750

48-
See also: [GitHub Developer Guide documentation](https://docs.github.com/rest/reference/actions#create-a-registration-token-for-an-organization).
51+
See also: [GitHub Developer Guide documentation](https://docs.github.com/rest/actions/self-hosted-runners#create-a-registration-token-for-an-organization).

0 commit comments

Comments
 (0)