repos_for_secret
Creates, updates, deletes, gets or lists a repos_for_secret resource.
Overview
| Name | repos_for_secret |
| Type | Resource |
| Id | github.actions.repos_for_secret |
Fields
The following fields are returned by SELECT queries:
- list_selected_repos_for_org_secret
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_secret | select | org, secret_name | page, per_page | Lists all repositories that have been selected when the visibilityfor repository access to a secret is set to selected.Authenticated users must have collaborator access to a repository to create, update, or read secrets. 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_secret | insert | org, secret_name, repository_id | Adds a repository to an organization secret when the visibility forrepository access is set to selected. For more information about setting the visibility, see Create orupdate an organization secret. 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_secret | replace | org, secret_name, selected_repository_ids | Replaces all repositories for an organization secret when the visibilityfor repository access is set to selected. The visibility is set when you Createor update an organization secret. Authenticated users must have collaborator access to a repository to create, update, or read secrets. 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_secret | delete | org, secret_name, repository_id | Removes a repository from an organization secret when the visibilityfor repository access is set to selected. The visibility is set when you Createor update an organization secret. Authenticated users must have collaborator access to a repository to create, update, or read secrets. 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 |
|---|---|---|
org | string | The organization name. The name is not case sensitive. |
repository_id | integer | |
secret_name | string | The name of the secret. |
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_secret
Lists all repositories that have been selected when the visibility
for repository access to a secret is set to selected.
Authenticated users must have collaborator access to a repository to create, update, or read secrets.
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_secret
WHERE org = '{{ org }}' -- required
AND secret_name = '{{ secret_name }}' -- required
AND page = '{{ page }}'
AND per_page = '{{ per_page }}'
;
INSERT examples
- add_selected_repo_to_org_secret
- Manifest
Adds a repository to an organization secret when the visibility for
repository access is set to selected. For more information about setting the visibility, see Create or
update an organization secret.
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_secret (
org,
secret_name,
repository_id
)
SELECT
'{{ org }}',
'{{ secret_name }}',
'{{ repository_id }}'
;
# Description fields are for documentation purposes
- name: repos_for_secret
props:
- name: org
value: "{{ org }}"
description: Required parameter for the repos_for_secret resource.
- name: secret_name
value: "{{ secret_name }}"
description: Required parameter for the repos_for_secret resource.
- name: repository_id
value: {{ repository_id }}
description: Required parameter for the repos_for_secret resource.
REPLACE examples
- set_selected_repos_for_org_secret
Replaces all repositories for an organization secret when the visibility
for repository access is set to selected. The visibility is set when you Create
or update an organization secret.
Authenticated users must have collaborator access to a repository to create, update, or read secrets.
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_secret
SET
selected_repository_ids = '{{ selected_repository_ids }}'
WHERE
org = '{{ org }}' --required
AND secret_name = '{{ secret_name }}' --required
AND selected_repository_ids = '{{ selected_repository_ids }}' --required;
DELETE examples
- remove_selected_repo_from_org_secret
Removes a repository from an organization secret when the visibility
for repository access is set to selected. The visibility is set when you Create
or update an organization secret.
Authenticated users must have collaborator access to a repository to create, update, or read secrets.
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_secret
WHERE org = '{{ org }}' --required
AND secret_name = '{{ secret_name }}' --required
AND repository_id = '{{ repository_id }}' --required
;