# Connect GitHub

> Install the Patchbay GitHub App, choose the repositories that Patchbay can read, and change that access later.

Patchbay reads your code from GitHub through the Patchbay GitHub App. A workspace can connect several GitHub accounts and organizations, and each connection is one installation of the app.

In your personal workspace, you can connect GitHub yourself. In a shared workspace, only workspace owners and administrators can connect or disconnect GitHub, and other members can see the connections but cannot change them.

## Install the GitHub App

You start the installation in Patchbay and choose the repositories on GitHub.

1. Open the workspace menu and select **Settings**.
2. Under **Integrations**, click **All integrations**, then click **GitHub**. On a new workspace, you can also click **Connect to GitHub** on the workspace home.
3. If no GitHub account is connected yet, click **Enable**. To connect one more account, click **Connect account**. GitHub opens the installation page of the Patchbay app.
4. On GitHub, choose the GitHub user or organization that owns the repositories.
5. Give the app access to all repositories, or only to the repositories that you select. If the app is already installed on that account, GitHub shows the installation instead, and you confirm it to link it to this workspace.

GitHub then sends you back to the GitHub settings in Patchbay. The connection shows the account name, its type (**Organization** or **User**) and the status **Connected**.

## What Patchbay reads

Patchbay reads only the repositories that the installation gives it. From these repositories, it reads the following:

- Branches, tags, commits and folders, to create components and releases.
- Pull requests, to list them in releases and to find the pending pull requests of a candidate.
- The `patchbay.yaml` file at the root of the default branch, as [Catalog file](/reference/catalog-file) describes.

GitHub also sends Patchbay an update when code changes. Patchbay uses these updates to move open candidates on tracked branches and tags, and to read changes to catalog files.

You can add a public repository without the app if you choose the **Public** scope in the repository search. Patchbay marks this repository **No installation**, and it does not read a catalog file from it or write to its pull requests.

## What Patchbay writes

Patchbay writes only to pull requests. It writes nothing until a project administrator turns this on under **Updates on pull requests** in the project settings. Each project can choose a comment, labels or both, and [Follow pull requests on GitHub](/releases/pull-requests) explains these settings.

Each choice needs one permission on the installation:

- A comment needs write access to pull requests.
- Labels need write access to issues.

If its labels do not exist in the repository, Patchbay creates them, and it changes only its own comment and its own labels. If an installation does not have the access that a setting needs, the project settings show a warning and Patchbay does not save that setting.

## Change repository access

You change the list of repositories on GitHub, and GitHub tells Patchbay about the change.

1. On the GitHub settings page in Patchbay, open the status menu of the connection.
2. Select **Configure in GitHub**.
3. On GitHub, add or remove repositories, then save.

If you change the permissions of the app on GitHub, select **Refresh from GitHub** in the same status menu. Patchbay then reads the permissions and the status of the installation again. If Patchbay loses access to a repository with a catalog file, you get a **Lost repository access** notification in the [inbox](/inbox).

## Connection status

Each connection shows one of three statuses, which tell you whether Patchbay can still read and write.

| Status | Meaning |
|---|---|
| **Connected** | Patchbay can read the repositories and write what the projects ask for. |
| **Needs attention** | The installation does not send code updates, or it cannot write to pull requests. Hover over or focus the warning icon to see the cause. |
| **Suspended** | The installation is suspended on GitHub, so Patchbay cannot read its repositories or update its pull requests. |

## Disconnect an account

1. Open the status menu of the connection and select **Disconnect…**.
2. Click **Disconnect** to confirm.

If no other workspace uses the installation, Patchbay also removes the app from the GitHub account. You can connect the account again at any time.

Index of all pages: https://patchbay.unbrikd.com/docs/llms.txt
