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

Add a repository to an organization variable

Adds a repository to an organization agent variable's selected repository access list. Use this operation when the variable's visibility is set to selected. The authenticated user needs collaborator access to the repository, and OAuth tokens and personal access tokens (classic) need the admin:org scope; private repositories also require the repo scope.

3 parameters
orgstringrequired
The organization name. The name is not case sensitive.
namestringrequired
The name of the organization agent variable.
repository_idintegerrequired
The unique integer identifier of the repository to add to the variable's selected repository access list.

2 status codes
204Returns no content and confirms that the repository was added to the variable's selected repository access list.
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, name, and repository_id path parameters identify the organization, variable, and repository; the authenticated user needs collaborator access to the repository. OAuth tokens and personal access tokens (classic) need the admin:org scope, and private repositories also require the repo scope.