Skip to Content
Stoatly Docs
Projects

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.

The GitHub page of Project settings, before a repository is connected.

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.

PermissionAccessWhat Stoatly uses it for
ContentsRead and writeReading your data files, and committing your changes to a branch it creates
Pull requestsRead and writeOpening pull requests, adding commits to them and reading their state
Commit statusesRead and writePosting the Stoatly check on each pull request
MetadataRead onlyReading basic details about the repository, which GitHub requires of every app
WorkflowsRead and writeWorking 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:

  1. In the repository on GitHub, open Settings, then Branches or Rules.
  2. Add a rule for your production branch and turn on Require status checks to pass before merging.
  3. 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.

On this page