Connect GitHub
A project needs a GitHub repository, because that's where Stoatly sends your changes. Install the Stoatly GitHub App, confirm it's you, then choose a repository. Only project admins can do this, and you do it once per project.

Connect a repository
Open the GitHub settings
In the project, open Settings, then GitHub.
Install the Stoatly GitHub App
Choose Install the app. On GitHub, pick the account that holds your repository, select the repository or all repositories, and press Install. Skip this step if the app is already installed there.
Confirm it's you
Back in Stoatly, choose Connect GitHub. Stoatly shows a code. Choose Open GitHub, enter the code and approve. GitHub then says your device is connected. Go back to the Stoatly tab, which carries on by itself.
Choose the repository
Pick the GitHub account, choose Continue, select the repository for this project and choose Connect repository.
Check the production branch
Stoatly sets the production branch to your repository's default branch. Pull requests merge into this branch, and Stoatly reads your live data from it. To use a different branch, change Production branch under Environments and save.
Stoatly uses a GitHub App, so it never stores a personal access token.
What the app can do
The Stoatly GitHub App asks for these permissions. You choose which repositories it can reach when you install it, and it can only use the permissions on those.
| Permission | Access | What Stoatly uses it for |
|---|---|---|
| Contents | Read and write | Reading your data files, and committing your changes to a branch it creates |
| Pull requests | Read and write | Opening pull requests, adding commits to them and reading their state |
| Commit statuses | Read and write | Posting the Stoatly check on each pull request |
| Metadata | Read only | Reading basic details about the repository, which GitHub requires of every app |
| Workflows | Read and write | Working in repositories that contain GitHub Actions workflows. Stoatly doesn't create or edit workflow files |
Stoatly never merges a pull request, and it doesn't change your branch rules.
What Stoatly listens for
The app subscribes to Pull request and Push events from GitHub. When a pull request is merged or closed, Stoatly updates your live data and your drafts to match. When someone pushes to a pull request's branch outside Stoatly, it marks that pull request as needing attention. Both cases are covered in Manage pull requests and When a pull request merges.
The Stoatly check
Stoatly posts a check called Stoatly on every pull request it manages. If the page says Stoatly can't post checks yet, open the Stoatly app's installation settings on GitHub and accept the request for the Commit statuses permission.
To make GitHub wait for the check before a pull request can merge:
- In the repository on GitHub, open Settings, then Branches or Rules.
- Add a rule for your production branch and turn on Require status checks to pass before merging.
- Add the Stoatly check to the required checks and save the rule.
Stoatly never changes your branch rules itself.
Rebuild from the production branch
The danger zone has an action that rebuilds all object types, fields and records from the current production branch. It deletes your unsaved draft edits in this project, and draft data linked to pull requests that are no longer open. Use it if your data has got out of step with the repository, for example after someone edited the data files directly. Changes it finds are recorded in History as External.
Disconnect
Disconnecting removes the link to the repository. Existing records aren't affected, and you can reconnect at any time.
Check before you rebuild
Rebuilding can't be undone. Send any changes you want to keep in a pull request first.