public_keys
Creates, updates, deletes, gets or lists a public_keys resource.
Overview
| Name | public_keys |
| Type | Resource |
| Id | github.actions.public_keys |
Fields
The following fields are returned by SELECT queries:
- get_environment_public_key
- 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) |
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_environment_public_key | select | owner, repo, environment_name | Get the public key for an environment, which you need to encrypt environment secrets. You need to encrypt a secret before you can create or update secrets. Anyone with read access to the repository can use this endpoint. If the repository is private, OAuth tokens and personal access tokens (classic) need the repo scope to use this endpoint. | |
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. Anyone with read access to the repository can use this endpoint. If the repository is private, OAuth tokens and personal access tokens (classic) need the repo scope to use this endpoint. | |
get_org_public_key | select | org | Gets your public key, which you need to encrypt secrets. You need to encrypt a secret before you can create or update secrets. The authenticated user 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. |
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 |
|---|---|---|
environment_name | string | The name of the environment. The name must be URL encoded. For example, any slashes in the name must be replaced with %2F. |
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_environment_public_key
- get_repo_public_key
- get_org_public_key
Get the public key for an environment, which you need to encrypt environment
secrets. You need to encrypt a secret before you can create or update secrets.
Anyone with read access to the repository can use this endpoint.
If the repository is private, OAuth 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.actions.public_keys
WHERE owner = '{{ owner }}' -- required
AND repo = '{{ repo }}' -- required
AND environment_name = '{{ environment_name }}' -- required
;
Gets your public key, which you need to encrypt secrets. You need to
encrypt a secret before you can create or update secrets.
Anyone with read access to the repository can use this endpoint.
If the repository is private, OAuth 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.actions.public_keys
WHERE owner = '{{ owner }}' -- required
AND repo = '{{ repo }}' -- required
;
Gets your public key, which you need to encrypt secrets. You need to
encrypt a secret before you can create or update secrets.
The authenticated user must have collaborator access to a repository to create, update, or read secrets.
OAuth tokens and personal access tokens (classic) need theadmin: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.
SELECT
id,
key_id,
created_at,
key,
title,
url
FROM github.actions.public_keys
WHERE org = '{{ org }}' -- required
;