Sample - GitHub REST API
GET/repos/{owner}/{repo}/environments/{environment_name}/secrets/public-key

Get an environment 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.

  • RetriesRetries up to 2×, 500ms backoff, 30s timeout.

3 parameters
ownerstringrequired
The account owner of the repository. The name is not case sensitive.
repostringrequired
The name of the repository without the `.git` extension. The name is not case sensitive.
environment_namestringrequired
The name of the environment. The name must be URL encoded. For example, any slashes in the name must be replaced with `%2F`.

1 status code
200Response
key_idstringrequired
The identifier for the key.
keystringrequired
The Base64 encoded public key.
idintegeroptional
urlstringoptional
titlestringoptional
created_atstringoptional