Skip to main content

Repository access with OAuth connection

Abstract

To take full advantage of all the features Bitrise offers, including automatic webhook registration, you need to connect your GitHub/GitLab/Bitbucket account to your Bitrise account.

Bitrise needs access to your code in a Git repository to be able to build. You can provide access on a project-by-project basis but we recommend connecting your Bitrise account to your Git provider accounts (GitHub, GitLab, and Bitbucket).

One of the ways to connect your accounts is by setting up an OAuth connection. You can connect all three Git provider accounts using OAuth, by either:

  • Connecting the account when adding a new Bitrise project.

  • Connecting the account from your Account settings page.

One account per Git provider

Please note that you cannot connect two accounts from the same Git provider (for example, two GitHub accounts) to Bitrise.

Connecting one Git provider account is not final. You can disconnect an account and connect a different one at any time: Linked the wrong Git account to Bitrise.

Connecting a Git provider with OAuth when adding a project

Connecting a Git provider account with an OAuth app allows Bitrise to:

  1. Log in to your bitrise.io account and select Bitrise CI on the left.

  2. Click New CI project.

  3. Set the project’s privacy setting.

  4. In the Select repository section, choose between selecting a remote repository or entering an URL manually.

    If you opt to enter a git URL manually, add it in the Git repository (clone) URL field and click Next.

  5. Choose the Git service provider of the app’s repository, if you chose to select a remote repository. If no account with that provider has been connected to your Bitrise account, the UI will display the option to connect.

    select_git_repo.png
  6. Click Connect account. This will take you to the login page of the Git provider.

  7. Log in to the Git provider account.

  8. You should be prompted to authorize bitrise.io - do it! If successful, you should be redirected to Bitrise, and a pop-up message should inform you that you successfully linked the account. Click Okay.

Connecting a Git provider with OAuth from the Account settings page

Connecting a Git provider account with an OAuth application allows Bitrise to:

  1. Log in to Bitrise, and select Bitrise CI from the left navigation menu.

  2. In the upper right corner, click the profile image to open the dropdown menu.

  3. Select the Account settings option.

    account-settings.png
  4. On the left, under Connected Git providers, click the toggle next to the name of the Git provider you wish to connect.

    Connect account to Bitrise
  5. Log in to the Git provider account.

  6. You should be prompted to authorize bitrise.io - do it! If successful, you should be redirected to Bitrise, and a pop-up message should inform you that you successfully linked the account. Click Okay.

Disconnecting a Git provider account

  1. Log in to Bitrise, and select Bitrise CI from the left navigation menu.

  2. In the upper right corner, click the profile image to open the dropdown menu.

  3. Select the Account settings option.

    account-settings.png
  4. On the left under Connected Git providers, click the toggle next to the name of the Git provider you wish to disconnect.

Switching from OAuth connection to the GitHub App

If your Bitrise project has an OAuth connection set up to your GitHub account, you can change it to the Bitrise GitHub App at any time without losing any functionality. We strongly recommend doing the switch: with the Bitrise GitHub App installed, you no longer need the service credential user, an SSH key, or a webhook to run Bitrise builds.

Can't switch back

Once you switch a Bitrise project from the OAuth connection to the GitHub App, you won't be able to switch back!

To switch:

  1. Install the Bitrise GitHub App as described in the relevant guide: Connecting a GitHub App from the Workspace settings page.

  2. Open your project on Bitrise with a user that has the Admin role on the project.

  3. On the main page of the project, click on the Project settings button.

    project-settings-button.png
  4. On the left navigation menu, select Integrations and go to the Git provider tab.

  5. In the Git integration status section, you can see a blue card with information about GitHub App support. To switch, click Switch to GitHub App.

    https-credentials.png