GitHub: Update a private registry for an organization
GitHub privateRegistries.privateRegistriesUpdateOrgPrivateRegistry: arguments, response, policy and SDK examples.
← Private registries operations · Get started
Operation github.private_registries_update_org_private_registry
Provider route: PATCH /orgs/{org}/private-registries/{secret_name}. Alter supplies the connection’s credentials and routing.
Call through Alter
Section titled “Call through Alter”Install @alter-ai/sdk @alter-ai/github with npm, or alter-sdk-github with pip. Supply your connected customer’s grant ID and the arguments described below.
import { App } from "@alter-ai/sdk";import { GitHubIntegration } from "@alter-ai/github";
async function execute(input: Parameters<GitHubIntegration["privateRegistries"]["privateRegistriesUpdateOrgPrivateRegistry"]>[0]) { const app = new App({ apiKey: process.env.ALTER_API_KEY! }); try { const provider = new GitHubIntegration(app, { grantId: process.env.PROVIDER_GRANT_ID! }); const call = await provider.privateRegistries.privateRegistriesUpdateOrgPrivateRegistry(input); const result = await call.wait(); return result.bodyJson(); } finally { await app.close(); }}import osfrom alter_sdk import Appfrom alter_sdk_github import GitHubIntegration
async def execute(arguments): async with App(api_key=os.environ["ALTER_API_KEY"]) as app: provider = GitHubIntegration(app, {"grant_id": os.environ["PROVIDER_GRANT_ID"]}) call = await provider.private_registries.private_registries_update_org_private_registry(arguments) result = await call.wait() return result.body_json()| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Additional keys: not allowed |
path | object | Required within parent | Additional keys: not allowed |
path.org | string | Required within parent | |
path.secret_name | string | Required within parent | |
body | object | Required within parent | |
body.account_id | string | Optional | The AWS account ID. Required when `auth_type` is `oidc_aws`. |
body.api_host | string | Optional | The Cloudsmith API host. Optional for `oidc_cloudsmith` auth type. If omitted, `api.cloudsmith.io` is used by default. |
body.audience | string | Optional | The OIDC audience. Optional for `oidc_aws`, `oidc_jfrog`, and `oidc_gcp`, and required for `oidc_cloudsmith` auth types. |
body.auth_type | string | Optional | The authentication type for the private registry. This field cannot be changed after creation. If provided, it must match the existing `auth_type` of the configuration. To change the authentication type, delete and recreate the configuration. One of: token, username_password, oidc_azure, oidc_aws, oidc_jfrog, oidc_cloudsmith, oidc_gcp, anonymous |
body.aws_region | string | Optional | The AWS region. Required when `auth_type` is `oidc_aws`. |
body.client_id | string | Optional | The client ID of the Azure AD application. Required when `auth_type` is `oidc_azure`. |
body.domain | string | Optional | The CodeArtifact domain. Required when `auth_type` is `oidc_aws`. |
body.domain_owner | string | Optional | The CodeArtifact domain owner (AWS account ID). Required when `auth_type` is `oidc_aws`. |
body.encrypted_value | string | Optional | The value for your secret, encrypted with [LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages) using the public key retrieved from the [Get private registries public key for an organization](https://docs.github.com/rest/private-registries/organization-configurations#get-private-registries-public-key-for-an-organization) endpoint. Pattern: ^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=|[A-Za-z0-9+/]{4})$ |
body.identity_mapping_name | string | Optional | The JFrog identity mapping name. Optional for `oidc_jfrog` auth type. |
body.jfrog_oidc_provider_name | string | Optional | The JFrog OIDC provider name. Required when `auth_type` is `oidc_jfrog`. |
body.key_id | string | Optional | The ID of the key you used to encrypt the secret. |
body.namespace | string | Optional | The Cloudsmith organization namespace. Required when `auth_type` is `oidc_cloudsmith`. |
body.registry_type | string | Optional | The registry type. 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 |
body.replaces_base | boolean | Optional | Whether this private registry should replace the base registry (e.g., npmjs.org for npm, rubygems.org for rubygems). When set to `true`, Dependabot will only use this registry and will not fall back to the public registry. When set to `false` (default), Dependabot will use this registry for scoped packages but may fall back to the public registry for other packages. Default: false |
body.role_name | string | Optional | The AWS IAM role name. Required when `auth_type` is `oidc_aws`. |
body.selected_repository_ids | array | Optional | 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`. |
body.selected_repository_ids[] | integer | Each item | |
body.service_account | string | Optional | The GCP service account email to impersonate. Optional for `oidc_gcp` auth type. If omitted, the federated token is used directly (direct WIF). |
body.service_slug | string | Optional | The Cloudsmith service account slug. Required when `auth_type` is `oidc_cloudsmith`. |
body.tenant_id | string | Optional | The tenant ID of the Azure AD application. Required when `auth_type` is `oidc_azure`. |
body.url | string | Optional | The URL of the private registry. Format: uri |
body.username | JSON | Optional | |
body.username (anyOf 1) | string | Alternative | 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. |
body.username (anyOf 2) | null | Alternative | |
body.visibility | string | Optional | 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. One of: all, private, selected |
body.workload_identity_provider | string | Optional | The full resource name of the GCP Workload Identity Provider (e.g. `projects/<NUM>/locations/global/workloadIdentityPools/<POOL>/providers/<PROVIDER>`). Required when `auth_type` is `oidc_gcp`. |
Response
Section titled “Response”Response media type: application/json. The table describes the pinned successful response. Referenced models link to their complete fields.
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | null | Root |
Policy, approvals and errors
Section titled “Policy, approvals and errors”SDK function policy ID: github.private_registries_update_org_private_registry. Catalog operation: private-registries/update-org-private-registry. Rules can name either ID; function rules distinguish managed calls and conservatively cover raw calls sharing the route. Existing grant permissions and policy rules apply. wait() returns an immediate result or waits for a required approval; it never approves the request itself. Persist the approval ID to resume after a restart.
Provider errors retain their response; JSON decoding raises ProviderAPIError for provider failures. ManagedOperationError identifies contract/input/retention errors. See error handling and provider-specific behavior. Sensitive input may be refused before approval storage. A decoding error never resubmits a write.
Pinned headers: {"X-GitHub-Api-Version": "2026-03-10", "User-Agent": "Alter", "Accept": "application/vnd.github+json"}
No-content response statuses: [204]