> For the complete documentation index, see [llms.txt](https://docs.pagerly.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.pagerly.io/sre-ai-agent/data-sources/github.md).

# GitHub

## What the Agent Can Do

* Search code across repos — find error handlers, configs, related code
* List recent commits — correlate deployments with incidents
* Search pull requests — find recent changes that might have caused issues
* List deployments and their statuses

## Setup Instructions

### Option A: GitHub App (Recommended)

1. Install the [Pagerly GitHub App](https://github.com/apps/pagerly/installations/new)
2. Select the repositories you want to grant access to
3. The integration will be configured automatically

### Option B: Personal Access Token

1. Go to GitHub → **Settings** → **Developer settings** → **Personal access tokens** → **Fine-grained tokens**
2. Click **Generate new token**
3. Set a name (e.g., `Pagerly`) and expiration
4. Under **Repository access**, select the repos you want to connect
5. Under **Permissions**, grant read-only access to: **Contents**, **Metadata**, **Pull requests**, **Issues**, and **Commit statuses**
6. Click **Generate token** and copy it

## Required Credentials (PAT method)

| Field                     | Description                       | Example          |
| ------------------------- | --------------------------------- | ---------------- |
| **Organization/Username** | GitHub org or username            | `acme-corp`      |
| **Personal Access Token** | Fine-grained PAT with read access | `github_pat_...` |

## Context Prompt Tips

> *"Main repos: org/api, org/frontend. Production branch is main. Deployments are tracked via GitHub Actions."*

## Docs

* [GitHub Personal Access Tokens](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens)
