Skip to content

Commit 1e9bf68

Browse files
authored
feat: many unreleased updates to endpoint methods (#607)
* WIP octokit/openapi updated * WIP octokit/openapi updated
1 parent 92ff437 commit 1e9bf68

File tree

261 files changed

+10200
-5945
lines changed

Some content is hidden

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

261 files changed

+10200
-5945
lines changed
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
---
2+
name: Add selected repository to an organization variable
3+
example: octokit.rest.actions.addSelectedRepoToOrgVariable({ org, name, repository_id })
4+
route: PUT /orgs/{org}/actions/variables/{name}/repositories/{repository_id}
5+
scope: actions
6+
type: API method
7+
---
8+
9+
# Add selected repository to an organization variable
10+
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.
12+
13+
```js
14+
octokit.rest.actions.addSelectedRepoToOrgVariable({
15+
org,
16+
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+
The organization name. The name is not case sensitive.
35+
36+
</td></tr>
37+
<tr><td>name</td><td>yes</td><td>
38+
39+
The name of the variable.
40+
41+
</td></tr>
42+
<tr><td>repository_id</td><td>yes</td><td>
43+
44+
</td></tr>
45+
</tbody>
46+
</table>
47+
48+
See also: [GitHub Developer Guide documentation](https://docs.github.com/rest/actions/variables#add-selected-repository-to-an-organization-variable).
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
---
2+
name: Add a repository to a required workflow
3+
example: octokit.rest.actions.addSelectedRepoToRequiredWorkflow({ org, required_workflow_id, repository_id })
4+
route: PUT /orgs/{org}/actions/required_workflows/{required_workflow_id}/repositories/{repository_id}
5+
scope: actions
6+
type: API method
7+
---
8+
9+
# Add a repository to a required workflow
10+
11+
Adds a repository to a required workflow. To use this endpoint, the required workflow must be configured to run on selected repositories.
12+
13+
You must authenticate using an access token with the `admin:org` scope to use this endpoint.
14+
15+
For more information, see "[Required Workflows](https://docs.github.com/actions/using-workflows/required-workflows)."
16+
17+
```js
18+
octokit.rest.actions.addSelectedRepoToRequiredWorkflow({
19+
org,
20+
required_workflow_id,
21+
repository_id,
22+
});
23+
```
24+
25+
## Parameters
26+
27+
<table>
28+
<thead>
29+
<tr>
30+
<th>name</th>
31+
<th>required</th>
32+
<th>description</th>
33+
</tr>
34+
</thead>
35+
<tbody>
36+
<tr><td>org</td><td>yes</td><td>
37+
38+
The organization name. The name is not case sensitive.
39+
40+
</td></tr>
41+
<tr><td>required_workflow_id</td><td>yes</td><td>
42+
43+
The unique identifier of the required workflow.
44+
45+
</td></tr>
46+
<tr><td>repository_id</td><td>yes</td><td>
47+
48+
The unique identifier of the repository.
49+
50+
</td></tr>
51+
</tbody>
52+
</table>
53+
54+
See also: [GitHub Developer Guide documentation](https://docs.github.com/rest/reference/actions#add-a-repository-to-selected-repositories-list-for-a-required-workflow).
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
---
2+
name: Create an environment variable
3+
example: octokit.rest.actions.createEnvironmentVariable({ repository_id, environment_name, name, value })
4+
route: POST /repositories/{repository_id}/environments/{environment_name}/variables
5+
scope: actions
6+
type: API method
7+
---
8+
9+
# Create an environment variable
10+
11+
Create an environment variable that you can reference in a GitHub Actions workflow.
12+
You must authenticate using an access token with the `repo` scope to use this endpoint.
13+
GitHub Apps must have the `environment:write` repository permission to use this endpoint.
14+
15+
```js
16+
octokit.rest.actions.createEnvironmentVariable({
17+
repository_id,
18+
environment_name,
19+
name,
20+
value,
21+
});
22+
```
23+
24+
## Parameters
25+
26+
<table>
27+
<thead>
28+
<tr>
29+
<th>name</th>
30+
<th>required</th>
31+
<th>description</th>
32+
</tr>
33+
</thead>
34+
<tbody>
35+
<tr><td>repository_id</td><td>yes</td><td>
36+
37+
The unique identifier of the repository.
38+
39+
</td></tr>
40+
<tr><td>environment_name</td><td>yes</td><td>
41+
42+
The name of the environment.
43+
44+
</td></tr>
45+
<tr><td>name</td><td>yes</td><td>
46+
47+
The name of the variable.
48+
49+
</td></tr>
50+
<tr><td>value</td><td>yes</td><td>
51+
52+
The value of the variable.
53+
54+
</td></tr>
55+
</tbody>
56+
</table>
57+
58+
See also: [GitHub Developer Guide documentation](https://docs.github.com/rest/actions/variables#create-an-environment-variable).

docs/actions/createOrUpdateEnvironmentSecret.md

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -15,25 +15,27 @@ this endpoint.
1515

1616
#### Example encrypting a secret using Node.js
1717

18-
Encrypt your secret using the [tweetsodium](https://github.com/github/tweetsodium) library.
18+
Encrypt your secret using the [libsodium-wrappers](https://www.npmjs.com/package/libsodium-wrappers) library.
1919

2020
```
21-
const sodium = require('tweetsodium');
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
2224
23-
const key = "base64-encoded-public-key";
24-
const value = "plain-text-secret";
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)
2530
26-
// Convert the message and key to Uint8Array's (Buffer implements that interface)
27-
const messageBytes = Buffer.from(value);
28-
const keyBytes = Buffer.from(key, 'base64');
31+
//Encrypt the secret using LibSodium
32+
let encBytes = sodium.crypto_box_seal(binsec, binkey)
2933
30-
// Encrypt using LibSodium.
31-
const encryptedBytes = sodium.seal(messageBytes, keyBytes);
34+
// Convert encrypted Uint8Array to Base64
35+
let output = sodium.to_base64(encBytes, sodium.base64_variants.ORIGINAL)
3236
33-
// Base64 the encrypted secret
34-
const encrypted = Buffer.from(encryptedBytes).toString('base64');
35-
36-
console.log(encrypted);
37+
console.log(output)
38+
});
3739
```
3840

3941
#### Example encrypting a secret using Python

docs/actions/createOrUpdateRepoSecret.md

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -15,25 +15,27 @@ this endpoint.
1515

1616
#### Example encrypting a secret using Node.js
1717

18-
Encrypt your secret using the [tweetsodium](https://github.com/github/tweetsodium) library.
18+
Encrypt your secret using the [libsodium-wrappers](https://www.npmjs.com/package/libsodium-wrappers) library.
1919

2020
```
21-
const sodium = require('tweetsodium');
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
2224
23-
const key = "base64-encoded-public-key";
24-
const value = "plain-text-secret";
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)
2530
26-
// Convert the message and key to Uint8Array's (Buffer implements that interface)
27-
const messageBytes = Buffer.from(value);
28-
const keyBytes = Buffer.from(key, 'base64');
31+
//Encrypt the secret using LibSodium
32+
let encBytes = sodium.crypto_box_seal(binsec, binkey)
2933
30-
// Encrypt using LibSodium.
31-
const encryptedBytes = sodium.seal(messageBytes, keyBytes);
34+
// Convert encrypted Uint8Array to Base64
35+
let output = sodium.to_base64(encBytes, sodium.base64_variants.ORIGINAL)
3236
33-
// Base64 the encrypted secret
34-
const encrypted = Buffer.from(encryptedBytes).toString('base64');
35-
36-
console.log(encrypted);
37+
console.log(output)
38+
});
3739
```
3840

3941
#### Example encrypting a secret using Python

docs/actions/createOrgVariable.md

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
---
2+
name: Create an organization variable
3+
example: octokit.rest.actions.createOrgVariable({ org, name, value, visibility })
4+
route: POST /orgs/{org}/actions/variables
5+
scope: actions
6+
type: API method
7+
---
8+
9+
# Create an organization variable
10+
11+
Creates an organization variable that you can reference in a GitHub Actions workflow.
12+
You must authenticate using an access token with the `admin:org` scope to use this endpoint.
13+
GitHub Apps must have the `organization_actions_variables:write` organization permission to use this endpoint.
14+
15+
```js
16+
octokit.rest.actions.createOrgVariable({
17+
org,
18+
name,
19+
value,
20+
visibility,
21+
});
22+
```
23+
24+
## Parameters
25+
26+
<table>
27+
<thead>
28+
<tr>
29+
<th>name</th>
30+
<th>required</th>
31+
<th>description</th>
32+
</tr>
33+
</thead>
34+
<tbody>
35+
<tr><td>org</td><td>yes</td><td>
36+
37+
The organization name. The name is not case sensitive.
38+
39+
</td></tr>
40+
<tr><td>name</td><td>yes</td><td>
41+
42+
The name of the variable.
43+
44+
</td></tr>
45+
<tr><td>value</td><td>yes</td><td>
46+
47+
The value of the variable.
48+
49+
</td></tr>
50+
<tr><td>visibility</td><td>yes</td><td>
51+
52+
The type of repositories in the organization that can access the variable. `selected` means only the repositories specified by `selected_repository_ids` can access the variable.
53+
54+
</td></tr>
55+
<tr><td>selected_repository_ids</td><td>no</td><td>
56+
57+
An array of repository ids that can access the organization variable. You can only provide a list of repository ids when the `visibility` is set to `selected`.
58+
59+
</td></tr>
60+
</tbody>
61+
</table>
62+
63+
See also: [GitHub Developer Guide documentation](https://docs.github.com/rest/actions/variables#create-an-organization-variable).

docs/actions/createRepoVariable.md

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
---
2+
name: Create a repository variable
3+
example: octokit.rest.actions.createRepoVariable({ owner, repo, name, value })
4+
route: POST /repos/{owner}/{repo}/actions/variables
5+
scope: actions
6+
type: API method
7+
---
8+
9+
# Create a repository variable
10+
11+
Creates a repository variable that you can reference in a GitHub Actions workflow.
12+
You must authenticate using an access token with the `repo` scope to use this endpoint.
13+
GitHub Apps must have the `actions_variables:write` repository permission to use this endpoint.
14+
15+
```js
16+
octokit.rest.actions.createRepoVariable({
17+
owner,
18+
repo,
19+
name,
20+
value,
21+
});
22+
```
23+
24+
## Parameters
25+
26+
<table>
27+
<thead>
28+
<tr>
29+
<th>name</th>
30+
<th>required</th>
31+
<th>description</th>
32+
</tr>
33+
</thead>
34+
<tbody>
35+
<tr><td>owner</td><td>yes</td><td>
36+
37+
The account owner of the repository. The name is not case sensitive.
38+
39+
</td></tr>
40+
<tr><td>repo</td><td>yes</td><td>
41+
42+
The name of the repository. The name is not case sensitive.
43+
44+
</td></tr>
45+
<tr><td>name</td><td>yes</td><td>
46+
47+
The name of the variable.
48+
49+
</td></tr>
50+
<tr><td>value</td><td>yes</td><td>
51+
52+
The value of the variable.
53+
54+
</td></tr>
55+
</tbody>
56+
</table>
57+
58+
See also: [GitHub Developer Guide documentation](https://docs.github.com/rest/actions/variables#create-a-repository-variable).

0 commit comments

Comments
 (0)