user_secrets
Creates, updates, deletes, gets or lists a user_secrets resource.
Overview
| Name | user_secrets |
| Type | Resource |
| Id | github.codespaces.user_secrets |
Fields
The following fields are returned by SELECT queries:
- list_repositories_for_secret_for_authenticated_user
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_repositories_for_secret_for_authenticated_user | select | secret_name | List the repositories that have been granted the ability to use a user's development environment secret. The authenticated user must have Codespaces access to use this endpoint. OAuth app tokens and personal access tokens (classic) need the codespace or codespace:secrets scope to use this endpoint. | |
add_repository_for_secret_for_authenticated_user | insert | secret_name, repository_id | Adds a repository to the selected repositories for a user's development environment secret. The authenticated user must have Codespaces access to use this endpoint. OAuth app tokens and personal access tokens (classic) need the codespace or codespace:secrets scope to use this endpoint. | |
set_repositories_for_secret_for_authenticated_user | replace | secret_name, selected_repository_ids | Select the repositories that will use a user's development environment secret. The authenticated user must have Codespaces access to use this endpoint. OAuth app tokens and personal access tokens (classic) need the codespace or codespace:secrets scope to use this endpoint. | |
remove_repository_for_secret_for_authenticated_user | delete | secret_name, repository_id | Removes a repository from the selected repositories for a user's development environment secret. The authenticated user must have Codespaces access to use this endpoint. OAuth app tokens and personal access tokens (classic) need the codespace or codespace:secrets scope to use this endpoint. |
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 |
|---|---|---|
repository_id | integer | |
secret_name | string | The name of the secret. |
SELECT examples
- list_repositories_for_secret_for_authenticated_user
List the repositories that have been granted the ability to use a user's development environment secret.
The authenticated user must have Codespaces access to use this endpoint.
OAuth app tokens and personal access tokens (classic) need the codespace or codespace:secrets scope to use this endpoint.
SELECT
repositories,
total_count
FROM github.codespaces.user_secrets
WHERE secret_name = '{{ secret_name }}' -- required
;
INSERT examples
- add_repository_for_secret_for_authenticated_user
- Manifest
Adds a repository to the selected repositories for a user's development environment secret.
The authenticated user must have Codespaces access to use this endpoint.
OAuth app tokens and personal access tokens (classic) need the codespace or codespace:secrets scope to use this endpoint.
INSERT INTO github.codespaces.user_secrets (
secret_name,
repository_id
)
SELECT
'{{ secret_name }}',
'{{ repository_id }}'
;
# Description fields are for documentation purposes
- name: user_secrets
props:
- name: secret_name
value: "{{ secret_name }}"
description: Required parameter for the user_secrets resource.
- name: repository_id
value: {{ repository_id }}
description: Required parameter for the user_secrets resource.
REPLACE examples
- set_repositories_for_secret_for_authenticated_user
Select the repositories that will use a user's development environment secret.
The authenticated user must have Codespaces access to use this endpoint.
OAuth app tokens and personal access tokens (classic) need the codespace or codespace:secrets scope to use this endpoint.
REPLACE github.codespaces.user_secrets
SET
selected_repository_ids = '{{ selected_repository_ids }}'
WHERE
secret_name = '{{ secret_name }}' --required
AND selected_repository_ids = '{{ selected_repository_ids }}' --required;
DELETE examples
- remove_repository_for_secret_for_authenticated_user
Removes a repository from the selected repositories for a user's development environment secret.
The authenticated user must have Codespaces access to use this endpoint.
OAuth app tokens and personal access tokens (classic) need the codespace or codespace:secrets scope to use this endpoint.
DELETE FROM github.codespaces.user_secrets
WHERE secret_name = '{{ secret_name }}' --required
AND repository_id = '{{ repository_id }}' --required
;