You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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.
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).
0 commit comments