Skip to main content

public_keys

Creates, updates, deletes, gets or lists a public_keys resource.

Overview

Namepublic_keys
TypeResource
Idgithub.codespaces.public_keys

Fields

The following fields are returned by SELECT queries:

Response

NameDatatypeDescription
idinteger
key_idstringThe identifier for the key. (example: 1234567)
created_atstring (example: 2011-01-26T19:01:12Z)
keystringThe Base64 encoded public key. (example: hBT5WZEj8ZoOv6TYJsfWq7MxTEQopZO5/IT3ZCVQPzs=)
titlestring (example: ssh-rsa AAAAB3NzaC1yc2EAAA)
urlstring (example: https://api.github.com/user/keys/2)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_repo_public_keyselectowner, repoGets 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_keyselectorgGets 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.

NameDatatypeDescription
orgstringThe organization name. The name is not case sensitive.
ownerstringThe account owner of the repository. The name is not case sensitive.
repostringThe name of the repository without the .git extension. The name is not case sensitive.

SELECT examples

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
;