Skip to content
Ona Docs

UpdateSCMIntegration

client.Runners.Configurations.ScmIntegrations.Update(ctx, body) (*RunnerConfigurationScmIntegrationUpdateResponse, error)
POST/gitpod.v1.RunnerConfigurationService/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"
ParametersExpand Collapse
body RunnerConfigurationScmIntegrationUpdateParams
ID param.Field[string]Optional
formatuuid
IssuerURL param.Field[string]Optional

issuer_url can be set to override the authentication provider URL, if it doesn’t match the SCM host.

OAuthClientID param.Field[string]Optional

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.

OAuthPlaintextClientSecret param.Field[string]Optional

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 param.Field[bool]Optional

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.

VirtualDirectory param.Field[string]Optional

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’.

ReturnsExpand Collapse
type RunnerConfigurationScmIntegrationUpdateResponse interface{…}

UpdateSCMIntegration

package main

import (
  "context"
  "fmt"

  "github.com/gitpod-io/gitpod-sdk-go"
  "github.com/gitpod-io/gitpod-sdk-go/option"
)

func main() {
  client := gitpod.NewClient(
    option.WithBearerToken("My Bearer Token"),
  )
  scmIntegration, err := client.Runners.Configurations.ScmIntegrations.Update(context.TODO(), gitpod.RunnerConfigurationScmIntegrationUpdateParams{
    ID: gitpod.F("d2c94c27-3b76-4a42-b88c-95a85e392c68"),
    OAuthClientID: gitpod.F("new_client_id"),
    OAuthPlaintextClientSecret: gitpod.F("new_client_secret"),
  })
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", scmIntegration)
}
{}
Returns Examples
{}