# GitHub

## About the integration <img src="https://2832637360-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M1bR_-Od0islbiOl4G0%2Fuploads%2Fgit-blob-ea6ff545a246caa64074ba809bbc86fcb8589071%2FGitHub-Mark-120px-plus.png?alt=media" alt="" data-size="line">

Integrating GitHub with Sleuth is simple. If you're connecting to a personal GitHub repo, you just need your credentials. If you're part of a GitHub organization and aren't the owner, you will need permission to allow Sleuth to connect to the repo (*after you connect you'll be able to select individual private or public repositories*).

If you are using GitHub issues to track issues, Sleuth will automatically discover your referenced issues once the integration is configured. You can still use other [issue tracker integrations](https://help.sleuth.io/integrations-1/issue-trackers) if you don't use GitHub issues.

{% hint style="info" %}
Check out the Sleuth app in the [GitHub marketplace](https://github.com/marketplace/sleuth-deployment-tracking).
{% endhint %}

## Setting up the integration

To set up the Sleuth GitHub integration:

1. Click **Add** in the top navigation bar and select **Integration** from the list.
2. Select **Code** from the drop-down located in the top right.
3. In the **GitHub** tile, click **Enable**.
4. Select the account with which you wish to authenticate your GitHub integration.
5. Select the repositories you wish to grant Sleuth access to by clicking either **All repositories** or **Only select repositories**. Note that if you choose **Only select repositories**, Sleuth will only be able to see and track deploys from the repos you select.\
   ![](https://2832637360-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M1bR_-Od0islbiOl4G0%2Fuploads%2FOPCPu9hDVgFrhCYKArol%2Fimage.png?alt=media\&token=46afb250-a03f-441c-8148-ccc9072c0597)
6. Click **Install & Authorize**.
7. Upon successful integration, you'll see **GitHub** marked as **Enabled** and a list of connections (*you can have more than one*) specified in the format **Connected via GitHub App (account `<GitHub user account>` for \_\_\_\_\_\_\_\_\_\_\_\_\_\_ repos.**&#x20;

   <figure><img src="https://2832637360-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M1bR_-Od0islbiOl4G0%2Fuploads%2FmlXQmSWtHYX2TgR5Qiw4%2Fimage.png?alt=media&#x26;token=4b7138db-1216-4bc7-b8dc-7da2ecb113b0" alt=""><figcaption></figcaption></figure>

## Configuring the integration

After the initial setup is complete, the GitHub integration can be used to set up:

* a **code deployment**: select a Sleuth project from the list and then follow the instructions for [creating a code deployment](https://help.sleuth.io/modeling-your-deployments/code-deployments/creating-a-deployment)
* a **build server**: select a Sleuth project from the list to set GitHub as the `Build integration provider` for the selected project
* an **issue tracker**: select a Sleuth project from the list to set GitHub as the `Issue integration provider` for the selected project

<figure><img src="https://2832637360-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M1bR_-Od0islbiOl4G0%2Fuploads%2FL47jINXASNJEJp7Ng0v9%2Fimage.png?alt=media&#x26;token=03eb591a-7c52-48c3-b72c-60e08f83f241" alt=""><figcaption></figcaption></figure>

## Adding more repositories

If you've selected **Only select repositories** during your initial setup and now want to give Sleuth access to more repositories, simply navigate to the **Integrations** page (*click the **Add** button in the top nav and then click **Integrations***), click the arrow to expand the **GitHub** tile, and follow the **Inspect** link next to the connection you wish to update.

<figure><img src="https://2832637360-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M1bR_-Od0islbiOl4G0%2Fuploads%2FHLOfRNwlxcfLMCyDjHhB%2Fimage.png?alt=media&#x26;token=1077a0cc-9cde-4eef-8117-f3e1de91b5f0" alt=""><figcaption></figcaption></figure>

This will take you to GitHub installation's page where you can update your preferences.

## In case of major changes to your GitHub organization

Making significant changes to your GitHub organization, such as **renaming the organization**, shouldn't have any effect on your existing GitHub-based code deployments and deploy data in Sleuth.&#x20;

As per [GitHub's official documentation](https://docs.github.com/en/organizations/managing-organization-settings/renaming-an-organization), any attempt to access links containing the old organization name should get automatically redirected.

That being said, if you want to be extra sure, you can always disconnect your GitHub integration in Sleuth and re-connect it after the renaming, which will ensure Sleuth has the most up-to-date org info. You are also welcome to let our Support Team know of this change, so they can help ensure a smooth transition.

## Removing the integration

#### If you wish to remove the GitHub integration for the organization:

1. Click the **Add** button in the top nav and select **Integrations** from the list.
2. Expand the **GitHub** integration card, and click **Remove** next to the connection you wish to remove. If you want to remove all of your GitHub connections, you'll need to repeat this step for each connection. A confirmation screen will appear warning you of the consequences of this action and prompting you to confirm your decision -> click **Confirm**.

After all connections are removed, the GitHub integration is then disconnected and no longer available for any projects within that organization.
