# Share Repository

> The sheet a GitHub repository card opens when the Agent lets you choose: pick a GitHub account and one of its repositories, then Share.

Source: https://air.build/docs/screens/chat/share-repository/

Share Repository is the sheet where you pick the GitHub repository an Agent asked you to choose. It lists the GitHub accounts the AirBuild GitHub App is installed on and the repositories each one grants; you pick one and tap **Share**, and the Agent's card is answered.

## Open it

In a chat, on a [GitHub repository](https://air.build/docs/cards/request-github-repo/) card that says "Choose a GitHub repository to share.", tap **Choose Repository**. If your GitHub account isn't connected, you sign in to GitHub first and the sheet opens after.

**iPhone**

The sheet opens over the chat. **Cancel** is at the top left and **Share** at the top right.

**Mac**

The sheet opens over the window, with the title **Share Repository** at the top and **Cancel** and **Share** at the bottom right. Return presses **Share**.

## What's on it

While the list loads, the sheet shows **Loading repositories…**. Then:

| Item | What it shows or does | Default |
| --- | --- | --- |
| **Account** | A menu of the GitHub accounts the AirBuild GitHub App is installed on. Choosing another account clears the repository pick. **Add Account…** at the bottom opens GitHub's installation page in your browser so you can install the app on another account; the menu stays on the account you had. | The first account |
| **Repository** | The repository you'll share. Tap it to open [Choose Repository](https://air.build/docs/screens/chat/choose-repository/), a searchable list of every account's repositories. Picking one there also switches **Account** to that repository's account. Shows **None** when the account grants no repository. | The account's first repository |
| Footer | "The agent will work with the repository you share. Manage repository permissions on GitHub." When the account grants no repository: "No repositories have been granted for this account. Grant access on GitHub and this list will refresh automatically." |  |
| **Share** | Shares the repository and answers the card. Dimmed until a repository is picked. Shows a spinner while it sends. Shown only when there's at least one account. |  |
| **Cancel** | Closes the sheet. The card stays waiting. |  |

The list refreshes when you come back to AirBuild, and again while you grant access on GitHub, so a repository you grant on GitHub appears without reopening the sheet. Nothing on the sheet locks while it refreshes.

## Share a repository

1. In **Account**, choose the GitHub account the repository is on.
2. Tap **Repository** and pick the repository in [Choose Repository](https://air.build/docs/screens/chat/choose-repository/).
3. Tap **Share**.

The sheet closes and the card says **Access granted to** and the repository. If someone else answered the card first, the sheet closes too.

If the repository isn't in the list, grant it to the AirBuild GitHub App on GitHub: choose **Add Account…** in **Account**, or **Connect More Repositories…** at the bottom of Choose Repository. Come back to AirBuild and it appears.

## When there's nothing to pick

| The sheet shows | What it means | What to do |
| --- | --- | --- |
| "Sign in with the GitHub account that can access the repository you want to share. Your agents never see your password." with **Connect GitHub** | No GitHub account is connected. | Tap **Connect GitHub** and sign in. The list loads when you're done. |
| "Your GitHub sign-in has expired. Sign in again to see your repositories." with **Connect GitHub** | The GitHub sign-in no longer works. | Tap **Connect GitHub** and sign in again. |
| "Grant repository access on GitHub. The list refreshes automatically when you return." with **Install AirBuild GitHub App** | The app isn't installed on any account yet. | Tap the button, install the app on GitHub and choose repositories, then come back. |
| "No repositories yet. Grant access on GitHub, then refresh." with **Refresh** | No account, and the app can't open the installation page. | Grant access on GitHub, then tap **Refresh**. |
| "Your organization uses single sign-on. Sign in to GitHub again and complete it when GitHub asks, and its repositories will appear here." with **Sign In to GitHub Again** | GitHub hides your only organization until you complete single sign-on. | Tap the button and complete single sign-on on GitHub. |

On iPhone and iPad, sign-in opens in a sheet inside the app. On the Mac it opens in your web browser. While a sign-in is in progress, its button (and **Sign In Again** in the notices below) shows a spinner instead.

### Single sign-on notices

| Notice | When | What to do |
| --- | --- | --- |
| **Single Sign-On Required**: "GitHub hides 1 organization until you sign in again and complete single sign-on." | Above the account menu, when GitHub hides one or more organizations. | Tap **Sign In Again** and complete single sign-on. |
| **Already Granted Access?**: "If your organization uses single sign-on, sign in to GitHub again and complete it when GitHub asks." | You went to GitHub's installation page from the sheet and came back to an empty list. | Wait a moment, since a grant can take a little time. If nothing shows, tap **Sign In Again**. |

## Messages

| Message | What it means | What to do |
| --- | --- | --- |
| **Unable to Share**, with a reason | The repository wasn't shared. The sheet stays open. | Tap **OK** and try **Share** again. "Unable to send to the agent. Check your connection and try again." means check your connection. "You don't have permission to do this. Ask the Team owner for help." means only the Team's owner can do it. "You're signed out. Sign in and try again." means sign in to AirBuild again. |
| A reason with **Try Again** | The list couldn't be loaded. | Tap **Try Again**. |
| **Account Already Connected**: "That GitHub account is already linked to another AirBuild account. Please disconnect it first or use a different GitHub account." | The GitHub account you signed in with belongs to another AirBuild account. | Tap **OK**. Disconnect it there, or sign in with another GitHub account. |
| **Unable to Connect GitHub**: "Connecting needs a recent sign-in. Sign out, sign back in, and try again." | Your AirBuild sign-in is too old to connect an account. | Tap **OK**, sign out of AirBuild and back in, then try again. |
| **Unable to Connect GitHub**: "The account could not be connected. Try again.", or another reason | Signing in to GitHub didn't finish. | Tap **OK** and tap the sign-in button again. |

Closing the GitHub sign-in page without finishing shows no alert.
