# Importing GitHub organization

When you import your GitHub organization or personal account to SonarQube Cloud, the corresponding [organization](https://docs.sonarsource.com/sonarqube-cloud/administering-sonarcloud/about-sonarqube-cloud-solution/resources-structure/organization "mention") is created in SonarQube Cloud and is bound to the DevOps platform organization. Each SonarQube Cloud organization corresponds one-to-one with a GitHub organization or personal account. See [binding-with-dop](https://docs.sonarsource.com/sonarqube-cloud/administering-sonarcloud/about-sonarqube-cloud-solution/resources-structure/binding-with-dop "mention") for more information.

{% hint style="warning" %}
SonarQube Cloud does not support linking an organization to more than one DevOps platform. If you want to link to more than one, you will need to create a separate organization to link to each DevOps platform.
{% endhint %}

The user account you used for the import is automatically assigned to the organization’s owners group which grants you administration rights on the organization. See [user-group-concept](https://docs.sonarsource.com/sonarqube-cloud/administering-sonarcloud/about-sonarqube-cloud-solution/user-management/user-group-concept "mention") for more details.

## Prerequisites <a href="#prerequisites" id="prerequisites"></a>

* You must have the Administer Organization permission to create and manage a SonarQube organization. See [organization-permissions](https://docs.sonarsource.com/sonarqube-cloud/administering-sonarcloud/managing-organization/users-and-permissions/organization-permissions "mention") for more information.
* You must be an owner of the GitHub organization.
* In SonarQube Cloud, each organization is assigned a subscription plan. Before importing your organization, choose the subscription plan suited to your needs, see [subscription-plans](https://docs.sonarsource.com/sonarqube-cloud/administering-sonarcloud/managing-subscription/subscription-plans "mention") for more details. In particular, determine the number of Lines of Code (LOC) you need. See [#loc-based-pricing](https://docs.sonarsource.com/sonarqube-cloud/managing-subscription/subscription-plans#loc-based-pricing "mention") for more information.

## Importing the organization <a href="#import-procedure" id="import-procedure"></a>

To import your GitHub organization or personal account to SonarQube Cloud:

{% stepper %}
{% step %}

#### Create new organization

1. Log in to SonarQube Cloud with your GitHub account. If you’re a member of an enterprise, you may use any of your DevOps Platform accounts or your SSO account. In that case, see [importing-from-multiple-platforms](https://docs.sonarsource.com/sonarqube-cloud/administering-sonarcloud/managing-organization/creating-organization/importing-from-multiple-platforms "mention") for important insights.
2. At the top right of the SonarQube Cloud interface, select the ✚ (plus) menu and then **Create new organization**. The **Create an organization** page opens.
   {% endstep %}

{% step %}

#### Import from a DevOps platform

Under **Import from a DevOps platform**, select **GitHub**. The **Install SonarQubeCloud** page opens with the list of GitHub organizations you have access to. The SonarQube Cloud app is required to allow SonarQube Cloud to access your GitHub organization.

* If the GitHub organization you want to import has the SonarQube Cloud application already installed, it will be listed on the page with the **Configure** button.
* If this organization is not already bound to an organization in SonarQube Cloud, you will be able to import it after the configuration step. To do so, select it in the list. The application configuration opens in GitHub. Check the configuration and select the **Save** button. You’ll be redirected to SonarQube Cloud. You can then follow the instructions in step 4.

Select the GitHub organization you want to import.

<figure><img src="https://2223713658-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FB4UT2GNiZKjtxFtcFAL7%2Fuploads%2Fgit-blob-11716fecc3c2967e3ea2c3e739b6909bc5f928ce%2F65561929c2002cc37e19285f95e5c03bdf06cb90.png?alt=media" alt="When importing your GitHub organization into SonarQube Cloud, and your GitHub organization already has SonarQUbe Cloud installed, you&#x27;ll see a list of those organizations that are ready to import."><figcaption></figcaption></figure>
{% endstep %}

{% step %}

#### Configure repository access

In **Repository access**, you can restrict access to the Git repositories that can be imported to SonarQube Cloud for analysis. You can always change this setting later, see [#modifying-repository-access](#modifying-repository-access "mention"). Once you’ve completed the app installation, you’ll be redirected to SonarQube Cloud’s **Create an organization** page.
{% endstep %}

{% step %}

#### Import organization details

In **Import organization details**, SonarQube Cloud suggests a GitHub Actions secret **Name** and **Key** for your SonarQube Cloud organization. The key is unique across all organizations within SonarQube Cloud. You can accept the suggestion or change it manually. You can't change it to an already existing key.
{% endstep %}

{% step %}

#### Auto-import new GitHub repositories <a href="#auto-import-new-github-repositories" id="auto-import-new-github-repositories"></a>

The **Auto-import new GitHub repositories** feature is enabled by default. From now on, this will automatically import newly added or created repositories in your GitHub organization into SonarQube Cloud without having to go through the manual new project analysis setup flow. For more information, see [auto-import-new-repos](https://docs.sonarsource.com/sonarqube-cloud/administering-sonarcloud/managing-organization/manage-org-projects/auto-import-new-repos "mention").

* As a requirement, **All repositories** must be selected in GitHub’s Repository Access settings, see [step 3](#configure-repository-access).
* Existing repositories in GitHub created prior to enabling the Auto-import new GitHub repositories feature are excluded.
* Note that a sudden spike in new repositories might cause you to reach your organization plan limits and pause analysis. Ensure the plan you select grants enough private lines of codes (LOC). For more information, see [#changing-loc](https://docs.sonarsource.com/sonarqube-cloud/managing-subscription/changing-plan#changing-loc "mention").
  {% endstep %}

{% step %}

#### Additional information

Select **Add additional info** to add:

* **Avatar**: Enter a URL link to a small image representing the organization. The avatar is displayed on the UI near the organization’s name.
* **Description**: Add a description of the organization.
* **URL**: Enter the URL of the organization’s website to be displayed in the UI.
  {% endstep %}

{% step %}

#### Select the subscription plan

1. Select the subscription plan for your organization. See [subscription-plans](https://docs.sonarsource.com/sonarqube-cloud/administering-sonarcloud/managing-subscription/subscription-plans "mention") for more details.
2. If you selected a paid plan, select the number of Lines of Code (LOC) for your plan and follow the instructions to enter your billing and payment information.
   {% endstep %}

{% step %}

#### Create the organization

Click **Create Organization** to finalize the process and open the new organization.
{% endstep %}
{% endstepper %}

{% hint style="info" %}
If the import fails because the organization already exists in SonarQube Cloud and you’ve lost administrator access to this organization, send a request to <contact@sonarsource.com> with all the necessary details.
{% endhint %}

{% hint style="warning" %}
If you remove the DevOps application (GitHub/Bitbucket) from your SonarQube Cloud organization, the organization will show as **Not Bound**, but some projects can keep a stale (“phantom”) ALM binding. This can break PR decoration and analysis and lead to confusing re‑binding behavior.

If the project binding is not removed before the DevOps application is removed, you will not be able to re-bind your project.

* This is a known issue and we are working on a fix.
  {% endhint %}

## Modifying the repository access rights of the organization <a href="#modifying-repository-access" id="modifying-repository-access"></a>

To modify the repository access rights of your GitHub organization:

1. Navigate to **Administration** > **Organization Settings** > **Organization binding**
2. Click on **Repository Access settings** link in the Auto-import new repositories section. You need a GitHub app admin permission to view the settings.

<figure><img src="https://2223713658-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FB4UT2GNiZKjtxFtcFAL7%2Fuploads%2FYLvTigaxxmSV8F387qS6%2Fgithub-repository-access-settings.png?alt=media&#x26;token=9dd38cf2-7d1d-45d7-bfc3-d667f5425ab3" alt="Accessing repository access settings"><figcaption></figcaption></figure>

3. In GitHub, scroll down to **Repository access**, choose the access option and click **Save**.

Alternatively:

1. At the top right of the SonarQube Cloud interface, select the ✚ (plus) menu and then **Create new organization**. The **Create an organization** page opens.
2. Select **GitHub**. The **Install SonarQubeCloud** page opens in GitHub.
3. Select **Configure** for your organization.
4. Scroll down to **Repository access**, choose the access option and click **Save**.

## Related pages <a href="#related-pages" id="related-pages"></a>

* [importing-bitbucket-workspace](https://docs.sonarsource.com/sonarqube-cloud/administering-sonarcloud/managing-organization/creating-organization/importing-bitbucket-workspace "mention")
* [importing-gitlab-group](https://docs.sonarsource.com/sonarqube-cloud/administering-sonarcloud/managing-organization/creating-organization/importing-gitlab-group "mention")
* [importing-azure-devops-organization](https://docs.sonarsource.com/sonarqube-cloud/administering-sonarcloud/managing-organization/creating-organization/importing-azure-devops-organization "mention")
* [creating-organization-manually](https://docs.sonarsource.com/sonarqube-cloud/administering-sonarcloud/managing-organization/creating-organization/creating-organization-manually "mention")
* [binding-unbound-organization](https://docs.sonarsource.com/sonarqube-cloud/administering-sonarcloud/managing-organization/creating-organization/binding-unbound-organization "mention")
* [changing-organization-binding](https://docs.sonarsource.com/sonarqube-cloud/administering-sonarcloud/managing-organization/creating-organization/changing-organization-binding "mention")
* [changing-organization-settings](https://docs.sonarsource.com/sonarqube-cloud/administering-sonarcloud/managing-organization/creating-organization/changing-organization-settings "mention")
* [deleting-organization](https://docs.sonarsource.com/sonarqube-cloud/administering-sonarcloud/managing-organization/creating-organization/deleting-organization "mention")
