UpdateSCMIntegration
Updates an existing SCM integration.
Use this method to:
- Modify integration settings
- Update credentials
- Change configuration
Examples
-
Update integration:
Updates OAuth credentials.
id: "d2c94c27-3b76-4a42-b88c-95a85e392c68" oauthClientId: "new_client_id" oauthPlaintextClientSecret: "new_client_secret"
Parameters
issuer_url can be set to override the authentication provider URL, if it doesn’t match the SCM host.
oauth_client_id can be set to update the OAuth app’s client ID. If an empty string is set, the OAuth configuration will be removed (regardless of whether a client secret is set), and any existing Host Authentication Tokens for the SCM integration’s runner and host that were created using the OAuth app will be deleted. This might lead to users being unable to access their repositories until they re-authenticate.
oauth_plaintext_client_secret can be set to update the OAuth app’s client secret. The cleartext secret will be encrypted with the runner’s public key before being stored.
pat can be set to enable or disable Personal Access Tokens support. When disabling PATs, any existing Host Authentication Tokens for the SCM integration’s runner and host that were created using a PAT will be deleted. This might lead to users being unable to access their repositories until they re-authenticate.
virtual_directory is the virtual directory path for Azure DevOps Server (e.g., “/tfs”). This field is only used for Azure DevOps Server SCM integrations and should be empty for other SCM types. Azure DevOps Server APIs work without collection when PAT scope is ‘All accessible organizations’.
UpdateSCMIntegration
import os
from gitpod import Gitpod
client = Gitpod(
bearer_token=os.environ.get("GITPOD_API_KEY"), # This is the default and can be omitted
)
scm_integration = client.runners.configurations.scm_integrations.update(
id="d2c94c27-3b76-4a42-b88c-95a85e392c68",
oauth_client_id="new_client_id",
oauth_plaintext_client_secret="new_client_secret",
)
print(scm_integration){}Returns Examples
{}