repos_for_org_variable
Creates, updates, deletes, gets or lists a repos_for_org_variable resource.
Overview
| Name | repos_for_org_variable |
| Type | Resource |
| Id | github.actions.repos_for_org_variable |
Fields
The following fields are returned by SELECT queries:
- list_selected_repos_for_org_variable
Response
| Name | Datatype | Description |
|---|---|---|
repositories | array | |
total_count | integer |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
list_selected_repos_for_org_variable | select | org, name | page, per_page | Lists all repositories that can access an organization variable that is available to selected repositories. Authenticated users must have collaborator access to a repository to create, update, or read variables. OAuth app tokens and personal access tokens (classic) need the admin:org scope to use this endpoint. If the repository is private, the repo scope is also required. |
add_selected_repo_to_org_variable | insert | org, name, repository_id | 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.Authenticated users must have collaborator access to a repository to create, update, or read secrets. OAuth tokens and personal access tokens (classic) need the admin:org scope to use this endpoint. If the repository is private, OAuth tokens and personal access tokens (classic) need the repo scope to use this endpoint. | |
set_selected_repos_for_org_variable | replace | org, name, selected_repository_ids | Replaces all repositories for an organization variable that is available to selected repositories. Organization variables that are available to selected repositories have their visibility field set to selected.Authenticated users must have collaborator access to a repository to create, update, or read variables. OAuth app tokens and personal access tokens (classic) need the admin:org scope to use this endpoint. If the repository is private, the repo scope is also required. | |
remove_selected_repo_from_org_variable | delete | org, name, repository_id | Removes a repository from an organization variable that is available to selected repositories. Organization variables that are available to selected repositories have their visibility field set to selected.Authenticated users must have collaborator access to a repository to create, update, or read variables. OAuth app tokens and personal access tokens (classic) need the admin:org scope to use this endpoint. If the repository is private, the repo scope is also required. |
Parameters
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
name | string | The name of the variable. |
org | string | The organization name. The name is not case sensitive. |
repository_id | integer | |
page | integer | The page number of the results to fetch. For more information, see "Using pagination in the REST API." |
per_page | integer | The number of results per page (max 100). For more information, see "Using pagination in the REST API." |
SELECT examples
- list_selected_repos_for_org_variable
Lists all repositories that can access an organization variable
that is available to selected repositories.
Authenticated users must have collaborator access to a repository to create, update, or read variables.
OAuth app tokens and personal access tokens (classic) need the admin:org scope to use this endpoint. If the repository is private, the repo scope is also required.
SELECT
repositories,
total_count
FROM github.actions.repos_for_org_variable
WHERE org = '{{ org }}' -- required
AND name = '{{ name }}' -- required
AND page = '{{ page }}'
AND per_page = '{{ per_page }}'
;
INSERT examples
- add_selected_repo_to_org_variable
- Manifest
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.
Authenticated users must have collaborator access to a repository to create, update, or read secrets.
OAuth tokens and personal access tokens (classic) need the admin:org scope to use this endpoint. If the repository is private, OAuth tokens and personal access tokens (classic) need the repo scope to use this endpoint.
INSERT INTO github.actions.repos_for_org_variable (
org,
name,
repository_id
)
SELECT
'{{ org }}',
'{{ name }}',
'{{ repository_id }}'
;
# Description fields are for documentation purposes
- name: repos_for_org_variable
props:
- name: org
value: "{{ org }}"
description: Required parameter for the repos_for_org_variable resource.
- name: name
value: "{{ name }}"
description: Required parameter for the repos_for_org_variable resource.
- name: repository_id
value: {{ repository_id }}
description: Required parameter for the repos_for_org_variable resource.
REPLACE examples
- set_selected_repos_for_org_variable
Replaces all repositories for an organization variable that is available
to selected repositories. Organization variables that are available to selected
repositories have their visibility field set to selected.
Authenticated users must have collaborator access to a repository to create, update, or read variables.
OAuth app tokens and personal access tokens (classic) need the admin:org scope to use this endpoint. If the repository is private, the repo scope is also required.
REPLACE github.actions.repos_for_org_variable
SET
selected_repository_ids = '{{ selected_repository_ids }}'
WHERE
org = '{{ org }}' --required
AND name = '{{ name }}' --required
AND selected_repository_ids = '{{ selected_repository_ids }}' --required;
DELETE examples
- remove_selected_repo_from_org_variable
Removes a repository from an organization variable that is
available to selected repositories. Organization variables that are available to
selected repositories have their visibility field set to selected.
Authenticated users must have collaborator access to a repository to create, update, or read variables.
OAuth app tokens and personal access tokens (classic) need the admin:org scope to use this endpoint. If the repository is private, the repo scope is also required.
DELETE FROM github.actions.repos_for_org_variable
WHERE org = '{{ org }}' --required
AND name = '{{ name }}' --required
AND repository_id = '{{ repository_id }}' --required
;