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

# GitHub

> Query pull requests, issues and contributors of a GitHub repository live from Explore and AI agents

The GitHub [live data source](https://docs.lightdash.com/integrations/live-data-sources) reads one GitHub repository. Lightdash turns each query into a GitHub search or contributor statistics request and shows what GitHub returns. Repository data stays in GitHub. It's a [level 2](https://docs.lightdash.com/integrations/live-data-sources#integration-levels) integration: its API filters records and reports a total, but doesn't group.

## Before you start

* **Live data sources enabled** for your organization. See [Live data sources](https://docs.lightdash.com/integrations/live-data-sources).
* **Admin role** in the Lightdash project.
* **A fine-grained personal access token** for the repository, with read access to **Metadata**, **Issues** and **Pull requests**. Create it in your GitHub **Settings** → **Developer settings** → **Personal access tokens**.

## Connect GitHub

1. On the nav bar, click **Browse** → **Semantic Layer**.
2. In the sidebar, select **Live data sources**, then click **Add**.
3. Select **GitHub**.
4. Enter a **Name**, such as `GitHub`. People see this name in Explore and agents use it to refer to the source.
5. Enter the **Repository** as `owner/name`, or paste its GitHub URL, and the **Personal access token**, then click **Test access**.
6. Click **Add source**.

Lightdash adds three tables to Explore: **Pull requests**, **Issues** and **Contributors**. Lightdash sets the source's [explore prefix](https://docs.lightdash.com/integrations/live-data-sources#explore-prefix) from its name.

## Dimensions and metrics

**Pull requests** and **Issues** share these dimensions:

| Dimension | Notes |
| - | - |
| Number, Title, URL | |
| Author, Assignee | GitHub logins. Assignee is the first assignee |
| Labels | Comma separated. **Is** keeps items that have the label |
| Comments | |
| Created, Updated, Closed | In UTC |
| State | Pull requests: `open`, `merged` or `closed` without merging. Issues: `open` or `closed` |
| Search text | Filter only. Matches whole words in the title or description |

Pull requests also have **Draft** and **Merged**. Issues also have **State reason**: `completed`, `not_planned` or `reopened`. Both tables have one metric, **Count**, taken from the total GitHub reports for the filters.

**Contributors** reads commit statistics for the repository's default branch:

| Field | Notes |
| - | - |
| Author, Week | Weeks start on Sunday, in UTC |
| Commits, Lines added, Lines deleted | Lines are 0 for repositories with 10,000 commits or more |

GitHub reports its top contributors only. When GitHub is still computing the statistics, Lightdash retries a few times, then asks you to try again.

## Supported features

| Feature | Available |
| - | - |
| Filters on dimensions | Yes, combined with AND and one value each |
| Splitting **Count** by a dimension | No. Filter by the dimension instead |
| Filters on metrics | No |
| OR filters and nested filter groups | No |
| Table calculations, custom metrics and custom dimensions | No |
| Period-over-period comparisons, pivots and date zoom | No |

## Limits

| Limit | Value |
| - | - |
| Most rows per query | 999. GitHub search returns at most 1,000 results |
| Timeout | 30 seconds per request |
| Queries at once | 3 per source |
| Calls per minute | 30 per source |
| Calls per hour | 1,800 per source |

When a query matches more than 999 items, Lightdash shows an error rather than a partial result. Add a filter, such as a date range.

## Example questions

* *"How many pull requests were merged last month?"*
* *"Open issues with the `bug` label, newest first."*
* *"Commits per author over the last 12 weeks."*

## Troubleshooting

**GitHub rejected the token.** Create a new personal access token and update the source.

**GitHub can't read the repository.** Check the repository name, and that the token has read access to Metadata, Issues and Pull requests for it.

**GitHub couldn't run this search.** Check the filter values.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.