Use the REST API to manage private registry configurations for organizations.
List private registries for an organization Code samples for "List private registries for an organization" Request exampleget/orgs/{org}/private-registries
Copy to clipboard curl request example
curl -L \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2022-11-28" \ https://api.github.com/orgs/ORG/private-registries
Response
Status: 200
{ "total_count": 1, "configurations": [ { "name": "MAVEN_REPOSITORY_SECRET", "registry_type": "maven_repository", "username": "monalisa", "created_at": "2019-08-10T14:59:22Z", "updated_at": "2020-01-10T14:59:22Z", "visibility": "selected" } ] }
Creates a private registry configuration with an encrypted value for an organization. Encrypt your secret using LibSodium. For more information, see "Encrypting secrets for the REST API."
OAuth app tokens and personal access tokens (classic) need the admin:org
scope to use this endpoint.
This endpoint works with the following fine-grained token types:
The fine-grained token must have the following permission set:
accept
string
Setting to application/vnd.github+json
is recommended.
org
string Required
The organization name. The name is not case sensitive.
Body parameters Name, Type, Descriptionregistry_type
string Required
The registry type.
Can be one of: maven_repository
, nuget_feed
, goproxy_server
, npm_registry
, rubygems_server
, cargo_registry
, composer_repository
, docker_registry
, git_source
, helm_registry
, hex_organization
, hex_repository
, pub_repository
, python_index
, terraform_registry
url
string Required
The URL of the private registry.
username
string or null
The username to use when authenticating with the private registry. This field should be omitted if the private registry does not require a username for authentication.
encrypted_value
string Required
The value for your secret, encrypted with LibSodium using the public key retrieved from the Get private registries public key for an organization endpoint.
key_id
string Required
The ID of the key you used to encrypt the secret.
visibility
string Required
Which type of organization repositories have access to the private registry. selected
means only the repositories specified by selected_repository_ids
can access the private registry.
Can be one of: all
, private
, selected
selected_repository_ids
array of integers
An array of repository IDs that can access the organization private registry. You can only provide a list of repository IDs when visibility
is set to selected
. You can manage the list of selected repositories using the Update a private registry for an organization endpoint. This field should be omitted if visibility
is set to all
or private
.
201
The organization private registry configuration
404
Resource not found
422
Validation failed, or the endpoint has been spammed.
Code samples for "Create a private registry for an organization" Request examplespost/orgs/{org}/private-registries
Copy to clipboard curl request example
curl -L \ -X POST \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2022-11-28" \ https://api.github.com/orgs/ORG/private-registries \ -d '{"registry_type":"maven_repository","url":"https://maven.pkg.github.com/organization/","username":"monalisa","encrypted_value":"c2VjcmV0","key_id":"012345678912345678","visibility":"private"}'
The organization private registry configuration
Status: 201
{ "name": "MAVEN_REPOSITORY_SECRET", "registry_type": "maven_repository", "username": "monalisa", "visibility": "selected", "selected_repository_ids": [ 1296269, 1296280 ], "created_at": "2019-08-10T14:59:22Z", "updated_at": "2020-01-10T14:59:22Z" }
get/orgs/{org}/private-registries/{secret_name}
Copy to clipboard curl request example
curl -L \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2022-11-28" \ https://api.github.com/orgs/ORG/private-registries/SECRET_NAME
The specified private registry configuration for the organization
Status: 200
{ "name": "MAVEN_REPOSITORY_SECRET", "registry_type": "maven_repository", "username": "monalisa", "visibility": "private", "created_at": "2019-08-10T14:59:22Z", "updated_at": "2020-01-10T14:59:22Z" }
Updates a private registry configuration with an encrypted value for an organization. Encrypt your secret using LibSodium. For more information, see "Encrypting secrets for the REST API."
OAuth app tokens and personal access tokens (classic) need the admin:org
scope to use this endpoint.
This endpoint works with the following fine-grained token types:
The fine-grained token must have the following permission set:
accept
string
Setting to application/vnd.github+json
is recommended.
org
string Required
The organization name. The name is not case sensitive.
secret_name
string Required
The name of the secret.
Body parameters Name, Type, Descriptionregistry_type
string
The registry type.
Can be one of: maven_repository
, nuget_feed
, goproxy_server
, npm_registry
, rubygems_server
, cargo_registry
, composer_repository
, docker_registry
, git_source
, helm_registry
, hex_organization
, hex_repository
, pub_repository
, python_index
, terraform_registry
url
string
The URL of the private registry.
username
string or null
The username to use when authenticating with the private registry. This field should be omitted if the private registry does not require a username for authentication.
encrypted_value
string
The value for your secret, encrypted with LibSodium using the public key retrieved from the Get private registries public key for an organization endpoint.
key_id
string
The ID of the key you used to encrypt the secret.
visibility
string
Which type of organization repositories have access to the private registry. selected
means only the repositories specified by selected_repository_ids
can access the private registry.
Can be one of: all
, private
, selected
selected_repository_ids
array of integers
An array of repository IDs that can access the organization private registry. You can only provide a list of repository IDs when visibility
is set to selected
. This field should be omitted if visibility
is set to all
or private
.
204
No Content
404
Resource not found
422
Validation failed, or the endpoint has been spammed.
Code samples for "Update a private registry for an organization" Request examplepatch/orgs/{org}/private-registries/{secret_name}
Copy to clipboard curl request example
curl -L \ -X PATCH \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2022-11-28" \ https://api.github.com/orgs/ORG/private-registries/SECRET_NAME \ -d '{"username":"monalisa","encrypted_value":"c2VjcmV0","key_id":"012345678912345678"}'
Response
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4