# GitHub

## Overview

GitHub is a code hosting and collaboration platform for version control and software development. Integrate with GitHub to track repository activity, manage developer workflows, and correlate development data with sales operations.

### Org-Level vs User-Level

> **Org-Level**: GitHub App for organization-wide access. Best for company-wide integrations with admin controls.
>
> **User-Level**: OAuth for personal GitHub account access. Use when you want to connect your personal repositories.

## Create Integration (Org-Level)

### Prerequisites

- GitHub account with organization owner or admin privileges
- GitHub API access (available on Free, Pro, and Team plans for limited API calls)

### Authenticate

1. Navigate to Settings > Integrations
2. Click "Connect GitHub"
3. Install the Suger GitHub App on your organization
4. Select the repositories to grant access to
5. Return to Suger to verify the connection

## Create User Integration

Use user-level integration when you want to connect your personal GitHub account.

1. Click `Connect Now` button in the User Integrations section
2. You will be redirected to GitHub to authorize
3. Grant access to your GitHub repositories
4. Return to Suger to confirm connection

:::warning
Deleting the integration will remove access to GitHub immediately.
:::

## Suger AI Tools

When GitHub is connected, the Suger AI agent can act on your repositories through Suger's built-in GitHub tools — no external MCP server is required. Capabilities are grouped below (~50 actions), plus an in-sandbox clone tool.

> **Org-level and user-level**: Both are supported; user-level takes precedence when both are connected. Org (GitHub App) connections mint a short-lived installation token per run.

| Capability | What the agent can do |
|------------|-----------------------|
| **Repositories & files** | Browse repositories and read or write file contents (e.g. `list-repos`, `get-file-contents`, `create-or-update-file`) |
| **Branches, commits & tags** | Manage refs (e.g. `create-branch`, `get-commit`, `create-tag-object`) |
| **Pull requests & reviews** | Open and merge PRs, request and submit reviews (e.g. `create-pull-request`, `merge-pull-request`, `submit-pull-request-review`) |
| **Issues, comments & labels** | Full issue lifecycle (e.g. `create-issue`, `add-issue-comment`, `create-label`) |
| **Releases** | Publish and edit releases and assets (e.g. `create-release`, `list-release-assets`) |
| **Actions & workflows** | Inspect and trigger workflow runs and fetch logs (e.g. `list-workflow-runs`, `trigger-workflow-dispatch`, `rerun-workflow-run`) |
| **Webhooks** | Manage repository webhooks (e.g. `register-webhook`, `deregister-webhook`) |

In addition, the **`github_clone`** tool clones a repository (by `owner/repo` shorthand or HTTPS URL) into the agent's sandbox using your connected GitHub account.

## Edit Integration

Editing is not supported. Delete and recreate.

## Delete Integration

Deleting removes the integration from Suger.

:::warning
This does not delete your repositories or data in GitHub. Check GitHub for any additional OAuth app cleanup if needed.
:::
