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

# GitHub

> Connect Rootly AI to GitHub — deploys, code diffs, and file ownership — via a single one-click authorization.

## Overview

GitHub is a one-click connector that gives Rootly AI read access to your organization's repositories during investigations. When an incident correlates with a recent deploy or a suspicious code change, Rootly AI can pull the deploy log, the exact commit diff, and the CODEOWNERS entry for the affected files automatically — no responder has to switch tabs.

Every query is **read-only**. Rootly AI can inspect commits, PRs, deploys, and file ownership but cannot push code, comment on PRs, or modify anything on the GitHub side.

***

## Before You Start

* **A GitHub organization** you have permission to install third-party GitHub Apps on.
* **Permission to install the Rootly AI GitHub App** for that organization — GitHub org **Owners** can install directly; other roles need install rights granted by an Owner.

***

## Setup

Open **Configuration → AI → Connectors** and click **Connect** on the GitHub card. Sign in to GitHub and install the **Rootly AI GitHub App** for the organization you want to connect — choose **All repositories** for broad coverage, or **Only select repositories** to scope Rootly AI to a specific set. When the install completes, the card flips to **Connected**.

***

## What Rootly AI Can Read

* **Deploys** — recent deploy events on connected repositories, including deploy time and target environment.
* **Code diffs** — the exact commits that landed in a given time window, per file.
* **File ownership** — CODEOWNERS entries so Rootly AI can suggest who owns the code area that broke.
* **Pull requests** — recent merged PRs, their descriptions, and their authors.

<Tip>
  Rootly AI reaches for GitHub when a question is about *"what changed?"* — pairing it with an observability connector (Sentry, Datadog) gives the strongest "what caused this?" signal.
</Tip>

## During an Incident

*"This error started 8 minutes after a deploy. Here's the diff that likely caused it."*

Rootly AI correlates a spike in errors against your recent GitHub deploys, then pulls the exact commit range that landed. During the investigation output, responders see the failing exception paired with the specific line-by-line change that introduced it — and the CODEOWNERS entry for the affected file, so they know who to page.

***

## Best Practices

* **Install with broad repo access.** Rootly AI can only see repositories the GitHub App installation covers. Selecting a narrow set of repositories on install means Rootly AI can't find the deploy that caused an incident in an unselected repo — choose **All repositories** unless you have a specific reason to restrict.
* **Keep CODEOWNERS current.** Rootly AI leans on CODEOWNERS to suggest owners for affected files. A stale CODEOWNERS file leads to stale owner suggestions.
* **Pair with a CI/CD connector.** GitHub tells Rootly AI what changed; a CI connector (Semaphore, or your team's own via [Custom](/ai/connectors/custom)) tells it whether the deploy pipeline succeeded.

***

## Troubleshooting

<AccordionGroup>
  <Accordion title="Some repositories return no data even though the card shows Connected" icon="key">
    The Rootly AI GitHub App installation doesn't cover those repos. On the GitHub side, open **Settings → GitHub Apps → Rootly AI → Configure**, then either switch to **All repositories** or add the missing repos to the selected list. Rootly AI will pick up the new scope on the next investigation — no reconnect needed.
  </Accordion>

  <Accordion title="Rootly AI cites the wrong file owner" icon="user-check">
    CODEOWNERS may be out of date, or the file isn't covered by any CODEOWNERS pattern. Update the file in your repository; Rootly AI will pick up the new owners on the next investigation.
  </Accordion>

  <Accordion title="Disconnected on the GitHub side" icon="plug-circle-xmark">
    If a GitHub admin uninstalls the Rootly AI GitHub App from the organization, Rootly's card still shows Connected but every query fails. Reconnect from Rootly to reinstall the app.
  </Accordion>
</AccordionGroup>

***

## Frequently Asked Questions

<AccordionGroup>
  <Accordion title="Can Rootly AI comment on PRs or push code?" icon="lock">
    No. Every connector is read-only. Rootly AI can read GitHub data but never invoke write actions.
  </Accordion>

  <Accordion title="Does the connector cover GitHub Enterprise Server?" icon="server">
    Coverage depends on how your GitHub Enterprise instance is reachable. Contact support if you're on a self-hosted GitHub Enterprise Server and want to confirm compatibility.
  </Accordion>

  <Accordion title="Does Rootly cache GitHub data?" icon="floppy-disk">
    Rootly does not maintain a persistent copy of GitHub data — queries run at investigation time and the response is used in reasoning only. Query results *do* appear in the LLM traces Rootly logs for quality monitoring, as with every tool call Rootly AI makes. See [Data Privacy for Rootly AI](/ai/data-privacy-for-rootly-ai) for the retention boundary.
  </Accordion>
</AccordionGroup>

***

## Related Pages

<CardGroup cols={3}>
  <Card title="Connectors Overview" icon="sparkles" href="/ai/connectors/overview">
    All connectors and how they fit together.
  </Card>

  <Card title="Sentry" icon="bug" href="/ai/connectors/sentry">
    Pair GitHub with Sentry for the strongest "what caused this?" signal.
  </Card>

  <Card title="Data Privacy for Rootly AI" icon="shield" href="/ai/data-privacy-for-rootly-ai">
    What Rootly AI sees, retention, and model training controls.
  </Card>
</CardGroup>
