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

# GitHub

> Connect GitHub.com and Enterprise Cloud repositories to Blitzy for AI-Native code generation

GitHub integration lets Blitzy access your repositories to analyze code, create branches, push commits, and open pull requests.

## Setup

<Steps>
  <Step title="Install the Blitzy GitHub App">
    Navigate to **Settings > Integrations** in your Blitzy dashboard and click **Connect GitHub**. You will be redirected to GitHub to authorize the application.
  </Step>

  <Step title="Select repository access">
    Choose whether to grant access to all repositories or specific repositories, then click **Install & Authorize**.
  </Step>
</Steps>

<Note>Organization admins must install the Blitzy GitHub App before team members can connect repositories.</Note>

### Granting Repository Access

If you initially selected specific repositories, you can add more later:

1. Go to **GitHub Settings > Applications > Blitzy**
2. Click **Configure** next to the Blitzy application
3. Scroll to **Repository access**
4. Select **Select repositories** and add the repositories you want Blitzy to access
5. Click **Save**

## Permissions

The Blitzy GitHub App requires specific permissions scoped to the minimum level needed.

| Permission                         | Access Level | Purpose                                                        |
| ---------------------------------- | ------------ | -------------------------------------------------------------- |
| Actions                            | Read & Write | Trigger, monitor, and cancel workflow runs                     |
| Attestations API                   | Read & Write | Sign and verify build artifact provenance                      |
| Checks                             | Read & Write | Post check runs and status annotations on commits and PRs      |
| Code                               | Read & Write | Clone repos, read files, create branches, and push commits     |
| Codespaces                         | Read & Write | Launch and manage development environments for code generation |
| Codespaces metadata                | Read         | List available codespaces and their configuration              |
| Commit statuses                    | Read & Write | Set pass/fail status indicators on individual commits          |
| Custom properties for repositories | Read & Write | Read and update repository-level custom metadata fields        |
| Dependabot alerts                  | Read         | Surface known dependency vulnerabilities during code analysis  |
| Deployments                        | Read & Write | Create deployments and update deployment status                |
| Discussions                        | Read & Write | Create and respond to repository discussion threads            |
| Environments                       | Read & Write | Configure deployment targets and environment protection rules  |
| Issues                             | Read & Write | Open, update, close, and comment on issues                     |
| Merge queues                       | Read & Write | Add and remove pull requests from merge queues                 |
| Metadata                           | Read         | Discover repositories, branches, and collaborators             |
| Packages                           | Read & Write | Publish and install GitHub Packages artifacts                  |
| Pages                              | Read & Write | Configure and deploy GitHub Pages sites                        |
| Pull requests                      | Read & Write | Open, update, close, and review pull requests                  |
| Repository advisories              | Read         | Review security advisories tied to repository dependencies     |
| Repository hooks                   | Read & Write | Register and manage webhook endpoints for event delivery       |
| Secret scanning alerts             | Read & Write | Triage and resolve detected secrets in code                    |
| Security events                    | Read & Write | Access code scanning and audit log security data               |
| Workflows                          | Read & Write | Create and modify GitHub Actions workflow definition files     |

### Permission Mapping Reference

| Operation           | Required Permission  | Documentation                                                                                                               |
| ------------------- | -------------------- | --------------------------------------------------------------------------------------------------------------------------- |
| Create branch       | Contents: write      | [Permissions Required for GitHub Apps](https://docs.github.com/en/rest/authentication/permissions-required-for-github-apps) |
| Create/push commits | Contents: write      | [Permissions Required for GitHub Apps](https://docs.github.com/en/rest/authentication/permissions-required-for-github-apps) |
| Create pull request | Pull requests: write | [Create Pull Request](https://docs.github.com/en/rest/pulls/pulls#create-a-pull-request)                                    |
| Close pull request  | Pull requests: write | [Update Pull Request](https://docs.github.com/en/rest/pulls/pulls#update-a-pull-request)                                    |
| Push branches       | Contents: write      | [Permissions Required for GitHub Apps](https://docs.github.com/en/rest/authentication/permissions-required-for-github-apps) |
| Clone repository    | Contents: read       | [Permissions Required for GitHub Apps](https://docs.github.com/en/rest/authentication/permissions-required-for-github-apps) |

<Note>HTTP-based Git access (clone, push) requires Contents permission as documented in GitHub's permissions guide.</Note>

## Organization Repositories

Organization admins must install and approve the Blitzy GitHub App:

1. Verify you have admin access to the organization
2. Install the app (organization owners may need to approve)
3. Select which organization repositories to grant access
4. Team members can then connect their accounts to access authorized repositories

## Additional Resources

* [Permissions Required for GitHub Apps](https://docs.github.com/en/rest/authentication/permissions-required-for-github-apps)
* [Choosing Permissions for a GitHub App](https://docs.github.com/en/apps/creating-github-apps/registering-a-github-app/choosing-permissions-for-a-github-app)
* [REST API Endpoints for Repositories](https://docs.github.com/en/rest/repos/repos)
