public_keys
Creates, updates, deletes, gets or lists a public_keys resource.
Overview
| Name | public_keys |
| Type | Resource |
| Id | github.codespaces.public_keys |
Fields
The following fields are returned by SELECT queries:
- get_repo_public_key
- get_org_public_key
Response
| Name | Datatype | Description |
|---|---|---|
id | integer | |
key_id | string | The identifier for the key. (example: 1234567) |
created_at | string | (example: 2011-01-26T19:01:12Z) |
key | string | The Base64 encoded public key. (example: hBT5WZEj8ZoOv6TYJsfWq7MxTEQopZO5/IT3ZCVQPzs=) |
title | string | (example: ssh-rsa AAAAB3NzaC1yc2EAAA) |
url | string | (example: https://api.github.com/user/keys/2) |
Response
| Name | Datatype | Description |
|---|---|---|
id | integer | |
key_id | string | The identifier for the key. (example: 1234567) |
created_at | string | (example: 2011-01-26T19:01:12Z) |
key | string | The Base64 encoded public key. (example: hBT5WZEj8ZoOv6TYJsfWq7MxTEQopZO5/IT3ZCVQPzs=) |
title | string | (example: ssh-rsa AAAAB3NzaC1yc2EAAA) |
url | string | (example: https://api.github.com/user/keys/2) |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_repo_public_key | select | owner, repo | Gets your public key, which you need to encrypt secrets. You need to encrypt a secret before you can create or update secrets. If the repository is private, OAuth app tokens and personal access tokens (classic) need the repo scope to use this endpoint. | |
get_org_public_key | select | org | Gets a public key for an organization, which is required in order to encrypt secrets. You need to encrypt the value of a secret before you can create or update secrets. OAuth app tokens and personal access tokens (classic) need the admin:org 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 |
|---|---|---|
org | string | The organization name. The name is not case sensitive. |
owner | string | The account owner of the repository. The name is not case sensitive. |
repo | string | The name of the repository without the .git extension. The name is not case sensitive. |
SELECT examples
- get_repo_public_key
- get_org_public_key
Gets your public key, which you need to encrypt secrets. You need to
encrypt a secret before you can create or update secrets.
If the repository is private, OAuth app tokens and personal access tokens (classic) need the repo scope to use this endpoint.
SELECT
id,
key_id,
created_at,
key,
title,
url
FROM github.codespaces.public_keys
WHERE owner = '{{ owner }}' -- required
AND repo = '{{ repo }}' -- required
;
Gets a public key for an organization, which is required in order to encrypt secrets. You need to encrypt the value of a secret before you can create or update secrets.
OAuth app tokens and personal access tokens (classic) need the admin:org scope to use this endpoint.
SELECT
id,
key_id,
created_at,
key,
title,
url
FROM github.codespaces.public_keys
WHERE org = '{{ org }}' -- required
;