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

# GitHub

> Index GitHub pull requests and issues so engineers can search across your organization's engineering history.

The GitHub connector indexes pull requests and issues from repositories in your GitHub organization (or user account). Architecture decisions in PR descriptions, bug context in issue threads, and historical engineering discussions become searchable through Hadiq.io.

## What gets indexed

* **Pull requests**: title, description/body, state, labels, assignees, and metadata (merged status, file count, commit count)
* **Issues**: title, body, comments, state, labels, and assignees
* **All repositories** in an organization or specific repos you configure

<Note>
  Code files and repository contents are not indexed by this connector. The connector focuses on the knowledge captured in PR descriptions and issue discussions.
</Note>

## Prerequisites

You need a **GitHub personal access token** (classic or fine-grained) with the following scopes:

* `repo` — read access to repositories (includes private repos)
* For organizations with SAML SSO: authorize the token for your organization after creation

To create a token, go to **GitHub** > **Settings** > **Developer settings** > **Personal access tokens**.

## Connect GitHub

<Steps>
  <Step title="Go to Admin > Connectors">
    Navigate to **Admin Panel** > **Connectors** and select **GitHub**.
  </Step>

  <Step title="Enter your access token">
    Paste your GitHub personal access token into the **Access token** field.
  </Step>

  <Step title="Set the organization or user">
    Enter the **Repository owner** — this is your GitHub organization name (e.g., `acme-corp`) or your personal GitHub username. Hadiq.io uses this to determine which repositories to index.
  </Step>

  <Step title="Configure repositories (optional)">
    Leave the **Repositories** field empty to index all repositories the token can access under the owner.

    To index specific repositories, enter repository names separated by commas:

    ```text theme={null}
    backend, frontend, infrastructure
    ```
  </Step>

  <Step title="Choose what to index">
    * **Include pull requests**: index PR titles, descriptions, and metadata (enabled by default)
    * **Include issues**: index issue titles, bodies, and comments (disabled by default)
    * **State filter**: choose `all`, `open`, or `closed` to filter by issue/PR state
  </Step>

  <Step title="Save">
    Click **Save**. Hadiq.io connects to GitHub and begins indexing. Large organizations with many repositories may take a while for the initial sync.
  </Step>
</Steps>

<Warning>
  If your organization enforces SAML SSO, your personal access token must be authorized for the organization separately. GitHub will show an **Authorize** button next to the organization name on the token settings page.
</Warning>

## GitHub Enterprise Server

Hadiq.io supports GitHub Enterprise Server (self-hosted GitHub) in addition to GitHub.com. To connect to your Enterprise Server instance, configure the GitHub API base URL in your Hadiq.io deployment settings to point to your server's API endpoint (typically `https://github.your-company.com/api/v3`).

Contact your Hadiq.io admin or refer to the [self-hosted deployment guide](/deployment) for instructions on configuring custom API endpoints for connectors.

## Permission syncing

Hadiq.io syncs repository-level permissions from GitHub. Users only see PRs and issues from repositories they have access to in GitHub.

* **Public repositories**: visible to all Hadiq.io users
* **Private repositories**: only visible to users who are members of the organization or are explicit collaborators

<Note>
  Automatic permission sync — where Hadiq.io continuously re-checks GitHub repository access — is available on the **Enterprise plan**.
</Note>

## Limitations

* Code file contents are not indexed (only PR and issue text).
* PR review comments and commit messages are not indexed.
* Wikis associated with repositories are not indexed by this connector.
* GitHub Actions logs are not indexed.
