PUT/orgs/{org}/actions/variables/{name}/repositories/{repository_id}

Add a repository to an organization variable

Adds a repository to an organization variable configured for selected repositories. Use name and repository_id to identify the variable and repository to include; the variable must have visibility set to selected. The authenticated user must have collaborator access to the repository, and the token must have the required organization scope.

3 parameters
orgstringrequired
The organization name; matching is not case-sensitive.
namestringrequired
The name of the organization variable.
repository_idintegerrequired
The integer identifier of the repository to add to the variable.

2 status codes
204Returns no content when the repository is added to the organization variable.
409Returned when the variable's visibility is not set to `selected`.

Error handling

A 409 is returned when the variable's visibility is not set to selected. The org path parameter identifies the organization, the name path parameter identifies the variable, and the repository_id path parameter identifies the repository; the authenticated user must have collaborator access to the repository. OAuth tokens and personal access tokens (classic) require the admin:org scope, and require the repo scope if the repository is private.