CreateSCMIntegration
client.runners.configurations.scmIntegrations.create(ScmIntegrationCreateParams { host, issuerUrl, oauthClientId, 5 more } body, RequestOptionsoptions?): ScmIntegrationCreateResponse { id }
POST/gitpod.v1.RunnerConfigurationService/CreateSCMIntegration
Creates a new SCM integration for a runner.
Use this method to:
- Configure source control access
- Set up repository integrations
- Enable code synchronization
Examples
-
Create GitHub integration:
Sets up GitHub SCM integration.
runnerId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" scmId: "github" host: "github.com" oauthClientId: "client_id" oauthPlaintextClientSecret: "client_secret"
CreateSCMIntegration
import Gitpod from '@gitpod/sdk';
const client = new Gitpod({
bearerToken: process.env['GITPOD_API_KEY'], // This is the default and can be omitted
});
const scmIntegration = await client.runners.configurations.scmIntegrations.create({
host: 'github.com',
oauthClientId: 'client_id',
oauthPlaintextClientSecret: 'client_secret',
runnerId: 'd2c94c27-3b76-4a42-b88c-95a85e392c68',
scmId: 'github',
});
console.log(scmIntegration.id);{
"id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"
}Returns Examples
{
"id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"
}