# Import from GitHub

> The GitHub sheet: sign in to GitHub, choose which repositories AirBuild can open, and pick one to bring into a project.

Source: https://air.build/docs/screens/chat/import-github/

The GitHub sheet brings a repository you have on GitHub into a project. It walks you through signing in to GitHub and choosing which repositories AirBuild can open, then lists every repository you can reach, across your account and your organizations, in one searchable list.

## Open it

**iPhone**

- **A new project from a repository**: tap **+** on Home, then **Import from GitHub**. When the menu has more than one way to import, it shows **Import Project** instead: tap it, then **GitHub**.
- **Fill an empty project**: in a project's chat that has no files yet, tap the **Import from GitHub** card ("Bring in a repository").
- **After a failed import**: in the project's notifications, tap **Try Again** on the failed import.
- 
- **A new project from a repository**: click **+** in the sidebar, then **Import from GitHub…**, or **Import Project › GitHub…** when there is more than one way to import. You can also choose **File › Import from GitHub…** in the menu bar.
- **Fill an empty project**: in a project's chat that has no files yet, click the **Import from GitHub** card ("Bring in a repository").
- **After a failed import**: in the project's notifications, click **Try Again** on the failed import.

The **+** menu offers GitHub only when you're in a Team. From the **+** menu, the project is created only after you pick a repository, and it takes the repository's name; backing out leaves nothing behind. From an empty project's card or **Try Again**, the files go into that project.

## What's on it

The sheet is titled **GitHub**. What it shows depends on how far you've got.

| Item | What it shows or does |
| --- | --- |
| **Cancel** | Closes the sheet. While an import is starting, it stops waiting for the answer; an import already taken on still runs, and shows on the chat's banner. On iPhone and iPad you can't swipe the sheet away while an import is starting. |
| **⋯** | Only with the repository list. **Connect More Repositories…** opens GitHub's page where you choose which repositories AirBuild can open. **Sign In to GitHub Again** signs in again (for an organization that uses single sign-on). **Refresh** asks GitHub again. |
| Mac's button beside **Cancel** | The next step: **Import** under the list (dimmed until you pick a repository), or **Connect GitHub**, **Choose Repositories on GitHub**, **Sign In to GitHub Again** or **Refresh** on the steps below. On iPhone and iPad those buttons are in the sheet itself. **Connect GitHub** and **Sign In to GitHub Again** are dimmed while a sign-in is in progress. On the Mac, Return presses the button shown there (**Import**, **Connect GitHub**, **Choose Repositories on GitHub**, **Sign In to GitHub Again** or **Refresh**). |

While the sheet first asks GitHub what you can reach, it shows a dimmed placeholder list in the shape of the one to come.

### Getting started: the three steps

Until there is a list, the sheet shows the GitHub mark, a title and a line under it, then three steps — **Sign in with GitHub**, **Choose which repositories AirBuild can open**, **Pick one to import** — with done steps ticked and the next one highlighted, and its button.

| Title | Line | Button |
| --- | --- | --- |
| **Import from GitHub** | "Bring a repository you already have on GitHub into a project. Your agents never see your password." | **Connect GitHub** |
| **Sign In to GitHub Again** | "Your GitHub sign-in has expired. Sign in again to see your repositories." | **Connect GitHub** |
| **Choose Repositories** | "AirBuild only sees the repositories you choose. Pick them on GitHub, and this list updates as soon as you come back." | **Choose Repositories on GitHub**, or **Refresh** when the app has no GitHub page to send you to |
| **Finish Single Sign-On** | "Your organization uses single sign-on. Sign in to GitHub again and complete it when GitHub asks, and its repositories will appear here." | **Sign In to GitHub Again** |

On iPhone and iPad, the step's button shows a spinner and is dimmed while a sign-in is in progress. Sign-in opens in a browser (on iPhone and iPad, inside the app). After you sign in, if you haven't chosen any repositories yet, GitHub's page for choosing them opens by itself. When you come back, the sheet checks GitHub again by itself; while it does, it shows **Waiting for GitHub…**.

### The repository list

| Item | What it shows or does |
| --- | --- |
| **Search repositories** | Finds a repository by name, owner or description, across every account. Results are ranked: names that start with what you typed first. The ✕ in the field clears it (iPhone, iPad). On the Mac, Esc in the field clears it. |
| **All** and account chips | iPhone and iPad, when you can reach more than one account: one chip per account (your own and each organization) with its number of repositories. Tap one to show only that account. On the Mac this is the **Account** menu. |
| Account sections | Each account's repositories under its name; on iPhone and iPad with its picture and **N repositories**, on the Mac with **N repositories** under the group. Most recently updated first. |
| A repository's row | Its name, its description (with the owner first while searching), and when it was last updated. While searching, the part of the name that matches is highlighted. A check mark replaces the time on the one you picked. |
| **N results** | Over the list while searching. |
| **Connect More Repositories…** | Always the last row. Opens GitHub's page where you choose which repositories AirBuild can open. When you come back, the list updates in place. |
| Footer | "Imported files will be added to your project workspace. Manage repository permissions on GitHub." |

When GitHub hides an organization behind single sign-on, a notice sits above the list: **Single Sign-On Required**, "GitHub hides N organization(s) until you sign in again and complete single sign-on.", with **Sign In Again**.

## Import a repository

**iPhone**

1. Open the sheet (see [Open it](https://air.build/docs/screens/chat/import-github/#open-it)). Sign in and choose repositories on GitHub if the sheet asks.
2. Find the repository, by scrolling or with **Search repositories**.
3. Tap it. The [Import confirmation](https://air.build/docs/screens/chat/import-confirmation/) opens.
4. Tap **Start Building**.

**Mac**

1. Open the sheet (see [Open it](https://air.build/docs/screens/chat/import-github/#open-it)). Sign in and choose repositories on GitHub if the sheet asks.
2. Find the repository, by scrolling or with **Search repositories**.
3. Click it. A check mark shows on it.
4. Click **Import**. The sheet shows **Importing owner/name…** while it starts.

Once the import has started, the sheet closes. The download's progress shows on the banner at the top of the chat and in the project's notifications; on iPhone and iPad it's also in the Live Activity.

## Messages

| Message | What it means | What to do |
| --- | --- | --- |
| "Ask the owner to import from GitHub." | You joined this Team; it imports with its owner's GitHub. | Ask the Team's owner to import the repository. |
| "No repositories match “…”." / "Not seeing it? It may not be granted to AirBuild yet." | Nothing you can reach matches your search. | Check the spelling, or tap **Connect More Repositories…** and choose the repository on GitHub. |
| **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 page and the list is still empty. | Tap **Sign In Again** and finish single sign-on on GitHub. |
| "This app directory already contains files. Please import into a new, empty project." | The project already has files, and imports never mix two codebases. | Import from **+** instead, which makes a new project. |
| "The host Mac is offline. Open AirBuild on it to bring this team back." (or a sentence naming the Mac) | The Team runs on a Mac that is asleep or has AirBuild closed. | Open AirBuild on that Mac, then tap **Try Again**. |
| Another message, with **Try Again** | The list couldn't load or the import couldn't start. | 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 from the other AirBuild account, 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 tap **Connect GitHub** again. |
| **Unable to Connect GitHub**: "The account could not be connected. Try again.", or another reason | The sign-in didn't connect. | Tap **OK**, then try **Connect GitHub** again. See [Connect your GitHub account](https://air.build/docs/team/connect-github-account/). |

Closing the GitHub sign-in page without finishing shows no alert: the step's button is ready to press again.
