# GitHub

![Image 1 of 1](https://assets.relyanceuat.xyz/images/docs/34541323129613/34541323120653.png)
GitHub is a website and cloud-based service for code hosting, version control, and collaboration. It helps developers store and manage their code, as well as track and control changes to their code.

In order to integrate Github with Relyance AI you will need to create an **Oauth2 / App Token** link from within Relyance AI.

### Permissions Relyance needs

GitHub has one method, **Oauth2 / App Token**, and the authorisation requests:

| Scope | Used for |
| --- | --- |
| `repo` | reading repository content and metadata |
| `read:org` | listing the organisation's repositories and teams |
| `read:user`, `user:email` | identifying the authorising account |
| `manage_billing:copilot` | reading Copilot seat assignment for AI discovery |

**`repo` is broad**: GitHub does not offer a read-only variant, so granting it
conveys write access to every repository the authorising account can reach, even
though Relyance only reads. Authorise as an account whose repository access
matches what you intend to scan — the connection can see exactly what that
account can see, no more and no less. For source-code scanning specifically, the
[Source Code Integration](/docs/integrations/source-code-integration-overview-and-technical-details/)
runs in your CI instead and needs no GitHub credential at all.

**In the Relyance AI application:**

1. Login to your Relyance account.
2. Navigate to the **Settings** (bottom-left corner).
3. Select **Integrations**.
4. Search and locate the **GitHub** integration card and click on it.
5. Click on the **Add Connection** button on the top right
6. Provide a meaningful name for the integration and click on the **Add** button
7. In the **Overview** section, select the integration features you wish to enable for the integration, review the **Scope and Permission**, and **Endpoint** details and click on **Continue**. For more details, see [Integration Features](/docs/introduction-to-relyance-ai/integration-features/)
8. In the **Connection** section, provide the appropriate values and click on **Continue**,

![Screenshot](https://assets.relyanceuat.xyz/images/docs/34541323129613/34541323122445.png)

9. In the Authentication section, select **Oauth2/App Token** and click on continue.  If prompted sign into Github. The new page will request Authorization for Relyance to connect with Github.

![Screenshot](https://assets.relyanceuat.xyz/images/docs/34541323129613/34541313779725.png)

***Note***: you may need to request **Organization access** on this page in order to share organizational repositories with Relyance AI.

![Github-1.png](https://assets.relyanceuat.xyz/images/docs/34541323129613/34541323125773.png)

 Click **Authorize relyance-integrationtest**.
10. Review the configuration summary from the Completion section and click on Finish.
11. Confirm the integration Status reflects Connected

![Screenshot](https://assets.relyanceuat.xyz/images/docs/34541323129613/34541313785229.png)

![The Authentication step for GitHub](https://assets.relyanceuat.xyz/images/docs/ui/github/08-connection-detail.png)

<!-- terraform-examples:begin (generated from the integration catalog; do not hand-edit) -->

## Manage this integration with Terraform

Connections for this integration can be managed as code with the [Relyance Terraform provider](https://registry.terraform.io/providers/Relyance/relyance/latest). Non-secret fields go in `auth.params`; secret fields go in `auth.secrets_wo`, which is write-only — never stored in Terraform state. Rotate secrets by bumping `auth.secrets_wo_version`.

The **OAuth (browser authorization)** method uses a browser authorization flow, so the connection is created in the Relyance app. Manage it in Terraform afterwards by importing it (`terraform import relyance_integration_connection.example github/<connection_id>`) or reading it with the `relyance_integration_connection` data source.

<!-- terraform-examples:end -->
