Connect to GitHub | Developer Connect | Google Cloud Documentation
Skip to main content Console English Deutsch Español – América Latina Français Indonesia Italiano Português – Brasil עברית 中文 – 简体 中文 – 繁體 日本語 한국어 Sign in Developer Connect Start free Home Documentation Application development Developer Connect Guides Connect to GitHub Stay organized with collections Save and categorize content based on your preferences. This page describes how to create connections to GitHub and create links to GitHub repositories.
You can complete these tasks using the Google Cloud console, or the Google Cloud CLI. These instructions are for application developers, platform administrators, and security managers who want to use GitHub source code repositories with Google. For example, you can get coding suggestions from Gemini Code Assist , tailored to your codebase, or you can use your linked GitHub repositories to develop web apps with Firebase App Hosting .
To learn more about Developer Connect, see Developer Connect overview . Before you begin Sign in to your Google Account. If you don't already have one, sign up for a new account . In the Google Cloud console, on the project selector page, select or create a Google Cloud project. Roles required to select or create a project Select a project : Selecting a project doesn't require a specific IAM role—you can select any project that you've been granted a role on.
Create a project : To create a project, you need the Project Creator role ( roles/resourcemanager.projectCreator ), which contains the resourcemanager.projects.create permission. Learn how to grant roles . Go to project selector Verify that billing is enabled for your Google Cloud project . Enable the Developer Connect, Secret Manager APIs, if any are not already enabled. Roles required to enable APIs To enable APIs, you need the serviceusage.services.enable permission.
If you created the project, then you likely already have this permission through the Owner role ( roles/owner ). Otherwise, you can get this permission through the Service Usage Admin role ( roles/serviceusage.serviceUsageAdmin ). Learn how to grant roles . Enable the APIs In the Google Cloud console, on the project selector page, select or create a Google Cloud project. Roles required to select or create a project Select a project : Selecting a project doesn't require a specific IAM role—you can select any project that you've been granted a role on.
Create a project : To create a project, you need the Project Creator role ( roles/resourcemanager.projectCreator ), which contains the resourcemanager.projects.create permission. Learn how to grant roles . Go to project selector Verify that billing is enabled for your Google Cloud project . Enable the Developer Connect, Secret Manager APIs, if any are not already enabled. Roles required to enable APIs To enable APIs, you need the serviceusage.services.enable permission.
If you created the project, then you likely already have this permission through the Owner role ( roles/owner ). Otherwise, you can get this permission through the Service Usage Admin role ( roles/serviceusage.serviceUsageAdmin ). Learn how to grant roles . Enable the APIs Ensure that you have access to an account on GitHub. To help keep your team's work secure, we recommend that you complete the tasks in this guide using a bot account or an account shared by your team, not a personal account.
Ensure that you own a GitHub repository, or have admin-level permissions on a shared repository. Optional: Create a customer-managed encryption key (CMEK) for encrypting the authentication secrets that Developer Connect creates. Optional: To use the command-line instructions in this guide, complete the following steps: Install the Google Cloud CLI . If you've installed gcloud CLI previously, make sure you have the latest available version by running gcloud components update .
Create a Developer Connect service account by running the following command, where PROJECT_ID is your Google Cloud project ID : gcloud beta services identity create \ --service = developerconnect.googleapis.com \ --project = PROJECT_ID Required roles To get the permissions that you need to create connections and links, ask your administrator to grant you the following IAM roles: If you aren't the project owner: Developer Connect Admin ( roles/developerconnect.admin ) on your user account.
If you plan to use a CMEK to encrypt the secrets that Developer Connect creates: Cloud KMS CryptoKey Encrypter/Decrypter ( roles/cloudkms.cryptoKeyEncrypterDecrypter ) on the Secret Manager Service Account. If you plan to use the gcloud CLI to complete the steps in this guide: Secret Manager Admin role ( roles/secretmanager.admin ) on the Developer Connect Service Account. If you plan to use the Google Cloud console to complete the steps in this guide: Project IAM Admin ( roles/resourcemanager.projectIamAdmin ) on your user account.
For more information about granting roles, see Manage access to projects, folders, and organizations . You might also be able to get the required permissions through custom roles or other predefined roles . Create a connection This section describes how to create a connection between Developer Connect and GitHub. If you're using the Google Cloud console, then you can also start adding links to repositories as you finish setting up your connection.
To create a new GitHub connection, select one of the following options: Console Initiate a connection by completing the following steps: In the Google Cloud console, open Developer Connect . Go to Developer Connect Developer Connect displays the Git repositories page. If you see a list of source code management providers: Start configuring your first connection by selecting a source code management provider. Click Connect on the GitHub card.
If you see a table listing existing connections : Set the source code management provider by clicking Create connection > GitHub . The Create Connection page opens. For Region , choose a region for your connection resources. For Name , enter a name for your new connection. Activate the Enable a data residency compliant connection checkbox to make this connection compliant with data residency requirements . GitHub connections created using the Google Cloud console are data-residency compliant if you activate this checkbox when you create the connection.
When you do this, Developer Connect creates a GitHub app When you create a GitHub connections using Google Cloud CLI, those connections are not data-residency compliant. All other connection types are data-residency compliant. Click Show more to see optional configuration settings. Optional: In the Encryption section, select a CMEK key to encrypt Secret Manager secrets that Developer Connect creates. Optional: By default, Developer Connect can act as a proxy for Git calls to GitHub.
To disable this option, clear the Enable Developer Connect proxy checkbox. Click Continue . Click I understand and continue to agree to share your GitHub OAuth token with Developer Connect and store it in Secret Manager. Sign in to GitHub if prompted to do so. Click Authorize Developer Connect to allow the Google Developer Connect app to access your GitHub account. If you don't see this prompt, then authorization has already been granted on this account.
If you selected Enable a data residency compliant connection , you're prompted to create a GitHub app. Provide a name for this GitHub app. Click Create GitHub app . Select the target where you want to install the app (your GitHub account or an organization). Select the repositories for which to install the GitHub app, or All repositories , and click Install . Select the repositories to link for this connection, and click Ok .
Click Link . GitHub creates a token and Developer Connect stores it in your Google Cloud project as a Secret Manager secret. For more information on managing secrets, see view secret details . If you enabled data residency, you now have a GitH
The rest of this page is on the live site.