> ## Documentation Index
> Fetch the complete documentation index at: https://docs.traversal.com/llms.txt
> Use this file to discover all available pages before exploring further.

# GitHub

> Connect GitHub to correlate incidents with recent code changes.

Connecting GitHub lets Traversal correlate incidents with recent code changes by pulling commits and pull requests, helping it explain "what changed" alongside telemetry evidence.

## What Traversal reads

* **Pull requests** — recent PRs, diffs, and review comments
* **Commits** — commit history and changed files
* **Code** — file contents and code search results

## Setup

<Tabs>
  <Tab title="GitHub App (recommended)">
    <Steps>
      <Step title="Install the app">
        In Traversal, go to **Company Knowledge > Integrations**, select GitHub, and click **Install GitHub App**. You'll be redirected to GitHub to authorize the Traversal app.
      </Step>

      <Step title="Select repositories">
        Choose the GitHub organization and repositories you want Traversal to access. After authorization, you'll be redirected back to Traversal with the Installation ID populated automatically.
      </Step>

      <Step title="Use an existing installation ID (optional)">
        If the Traversal GitHub App is already installed, you can paste the existing **Installation ID** instead of running the install flow again.
      </Step>

      <Step title="Save">
        Click **Save**.
      </Step>
    </Steps>
  </Tab>

  <Tab title="Personal access token">
    <Steps>
      <Step title="Generate a token">
        Go to [github.com/settings/tokens](https://github.com/settings/tokens) and create a new token with scopes: `repo`, `read:org`.
      </Step>

      <Step title="Configure in Traversal">
        In **Company Knowledge > Integrations**, select GitHub, switch to **Personal Access Token**, enter the token, and click **Save**.
      </Step>
    </Steps>
  </Tab>

  <Tab title="GitHub Enterprise">
    <Steps>
      <Step title="Generate a token">
        On your GitHub Enterprise instance, create a personal access token with scopes: `repo`, `read:org`.
      </Step>

      <Step title="Configure in Traversal">
        In **Company Knowledge > Integrations**, select GitHub, switch to **GitHub Enterprise**, enter your API URL (e.g., `https://github.yourcompany.com/api/v3`) and the token, and click **Save**.
      </Step>
    </Steps>
  </Tab>
</Tabs>

### Optional scoping

You can optionally narrow GitHub access in Traversal:

* Use **Repositories** for a list of repositories in `owner/repo` format
* Use **Organization** for organization-wide access

### Required permissions (GitHub App, read-only)

**Repositories:** Commit statuses, Contents, Custom properties, Dependabot alerts, Deployments, Issues, Metadata, Pull Requests

**Organization:** Events, Knowledge bases, Issue Types, Members

## More information

* [GitHub App authentication](https://docs.github.com/en/apps/creating-github-apps/authenticating-with-a-github-app)
* [Installing GitHub Apps](https://docs.github.com/en/apps/using-github-apps/installing-your-own-github-app)
