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

# GitHub

> Connect GitHub for source context, fix PRs, and change-tracking issues

The GitHub integration gives sureops read access to your repositories for service ownership context, CODEOWNERS-derived routing, and deployment correlation. It also enables the fix PR feature — when a diagnosis points to a code change as the root cause, sureops can open a draft PR in your repository with the proposed fix.

***

## What this integration enables

* **Repository context** — agents can read `.sureops/services.yaml`, `catalog-info.yaml`, and `CODEOWNERS` files to understand service ownership and relevant runbooks
* **Fix PRs** — resolution specialist opens draft pull requests against your repository for code-change recommendations (requires a default repository configured)
* **Deployment correlation** — agents can correlate recent commits and PR merges with incident timing during diagnosis
* **Change-tracking issues** — sureops files GitHub Issues as change-tracking records for incidents (when GitHub is selected as your change tracker)

***

## Prerequisites

* A GitHub organization where you have **Owner** or sufficient admin permissions to install a GitHub App
* The repositories you want sureops to access must be selected during the app installation flow

***

## Setup

<Steps>
  <Step title="Install the GitHub App">
    In sureops, go to **Settings → Integrations** and click **Connect** next to GitHub.

    You will be redirected to GitHub to install the sureops GitHub App on your organization. Select which repositories sureops can access — you can grant access to all repositories or choose specific ones.
  </Step>

  <Step title="Select repositories">
    During the GitHub App installation, choose which repositories sureops can read. For fix PRs and change-tracking issues to work, include at least the repositories where your services' source code lives.

    After installation, you'll be redirected back to sureops with the connection confirmed.
  </Step>

  <Step title="Configure a default repository (optional)">
    If you want sureops to file change-tracking issues and fix PRs against a specific repository, set a **Default Repository** in the integration configuration field.

    Format: `owner/repo` (for example, `acme/incidents`). If left blank, the GitHub integration works for read-only context but fix PRs will not be filed automatically.
  </Step>
</Steps>

***

## Configuration fields

| Field              | Required | Description                                                                                                    |
| ------------------ | -------- | -------------------------------------------------------------------------------------------------------------- |
| Default Repository | No       | Where sureops files change-tracking Issues and fix PRs (e.g. `acme/incidents`). Leave blank for read-only use. |

***

## Common errors

| Error                                 | Fix                                                                                                                                                                      |
| ------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| "Installation not found"              | You approved the App install but on the wrong GitHub org. Go back through the install flow and select the correct organization.                                          |
| "No repos with sureops-managed topic" | You connected GitHub but no repository is opted in. Add the GitHub topic `sureops-managed` to at least one repository and re-sync from Settings → Integrations → GitHub. |

***

## Official documentation

* [GitHub Apps documentation](https://docs.github.com/en/apps)
* [Managing GitHub App permissions](https://docs.github.com/en/apps/maintaining-github-apps/editing-a-github-apps-permissions)
