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

# GitHub

> Connect Tierity to GitHub to review pull requests, view commits and file diffs, read and post comments, and approve PRs — all without leaving the platform.

## Overview

The GitHub integration makes Tierity a first-class PR review environment. Once connected, GitHub appears as an **external source** in your sidebar, giving you access to:

* Pull request list across all connected repositories
* Full PR detail: commits, file diffs with syntax highlighting, reviews, inline code comments
* Post issue comments and submit reviews (Approve, Request Changes, Comment) directly from Tierity
* Expandable diff context on inline review comments

## PAT requirements

GitHub access uses a **Personal Access Token (PAT)**. You configure your own PAT in **Profile → Connections tab**.

### Recommended: fine-grained PAT

Create a fine-grained PAT at **GitHub → Settings → Developer Settings → Personal Access Tokens → Fine-grained tokens**.

| Permission | Access |
| - | - |
| Pull requests | Read and Write |
| Contents | Read |
| Commit statuses | Read |
| Metadata | Read |

**Important:** If you're accessing repositories in a GitHub organization, the PAT's **resource owner** must be set to that organization — not your personal account. GitHub fine-grained PATs scoped to "all repositories owned by you" only cover your personal repos.

To create an org-scoped PAT, go to:

```
github.com/organizations/{your-org}/settings/personal-access-tokens
```

### Alternative: classic PAT

A classic PAT with the `repo` scope works for both personal and organization repositories without the resource owner restriction.

## Multi-PAT support

If you work across multiple GitHub organizations with different access scopes, you can add multiple PATs in **Profile → Connections**. Each PAT can be scoped to a specific organization (by org name) or set as a catch-all.

When Tierity fetches data for a PR:

1. It looks for a PAT matching the PR's repository owner.
2. If no match, it falls back to your catch-all PAT.
3. If no multi-PAT is configured, it falls back to your legacy Code Hosting Connection PAT.

## Setting up the GitHub App

For organization-wide sync of pull requests, repositories, and webhook events, connect a **GitHub App**:

**1. Install the GitHub App**

1. Go to **Config → Integrations → GitHub**.
2. Click **Install GitHub App**.
3. You'll be redirected to GitHub to install the Tierity GitHub App.
4. Select the GitHub organization or personal account.
5. Choose which repositories to grant access to.
6. Click **Install**.

You'll be redirected back to Tierity once installation is complete.

**2. Sync repositories**

After installing, click **Sync Repositories** to pull the list of repositories the app has access to. This populates the repository list in the GitHub external source.

**3. Sync pull requests**

Click **Sync Pull Requests** to import open PRs from connected repositories into Tierity. Pull requests are then available for review in the GitHub external source.

## Reviewing pull requests

Navigate to **Sources → GitHub** in the sidebar to access the PR list.

### PR detail view

Click any pull request to open the detail view. The tabs show:

| Tab | Contents |
| - | - |
| **Commits** | List of commits with author, SHA, and timestamp |
| **Files** | Changed files with expandable diffs. Supports filename search and collapse/expand per file. |
| **Reviews** | Review summaries (Approved, Changes Requested, Commented). Submit a new review from the top panel. |
| **Inline** | Inline code review comments attached to specific lines. Expandable diff context per comment. |
| **Comments** | General PR issue comments. |

All comment and review bodies render full markdown.

### Submitting a review

From the **Reviews** tab, the review panel is at the top:

1. Optionally type a review comment.
2. Click **Approve**, **Request changes**, or **Comment only**.

The review is submitted to GitHub immediately.

### Posting a comment

From the **Comments** tab:

1. Type your comment in the input at the bottom.
2. Click **Post comment**.

The comment appears on the GitHub pull request.

## Webhook events

When the GitHub App is installed, Tierity responds to the following webhook events:

| Event | Tierity action |
| - | - |
| `pull_request.opened` | Import new PR into Tierity |
| `pull_request.synchronize` | Update PR data (commits, changed files) |
| `pull_request.closed` / `merged` | Update PR status |
| `pull_request_review` | Store review in Tierity |
| `pull_request_review_comment` | Store inline comment in Tierity |
| `issue_comment` | Store PR issue comment in Tierity |

## Uninstalling the GitHub App

To completely remove the GitHub App from your GitHub account or organization:

1. Go to **GitHub → Settings → Applications → Installed GitHub Apps**.
2. Find the Tierity app and click **Configure**.
3. Click **Uninstall**.

> [!WARNING]
>
> Uninstalling the GitHub App immediately stops all webhook delivery and PR sync. Reconnecting requires reinstalling the app from the Tierity marketplace.


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