Skip to main content
The GitHub App reads your repository and posts results to it. For a build, OuterLayer also issues short-lived tokens through the App. Each token covers one repository. This page lists the App’s permissions and the limits of those tokens.

Permissions the App asks for

This table lists what the App asks for. An installation holds only the permissions its owner accepted. See Accept a permission the App asks for. OuterLayer’s servers act with every permission the installation accepted, on every repository the installation includes. Only a token that OuterLayer gives to a build or a run is limited to one repository and to fewer permissions. See Build tokens.

Accept a permission the App asks for

The App is installed on your GitHub organization or account. That installation keeps the permissions its owner accepted. When the App asks for more, GitHub does not widen the installation. An owner of the installation must accept the request. Until an owner accepts, OuterLayer refuses a token request that needs the missing permission, with repository_permissions_pending. That includes opening or editing a build’s pull request when the installation never accepted Pull requests write. Everything else keeps working. To accept, open the installation’s settings link that outerlayer doctor prints. On GitHub the request shows as Review request. One acceptance covers every repository in the installation.

Check what each repository is missing

Run outerlayer doctor on any signed-in machine, with a factory key or a login. It adds one GitHub App: owner/name check for each repository connected to the factory. The check warns in these cases:
  • The installation has not accepted a permission that builds need. The check names each one, and the fix says who acts. An owner of the installation accepts a permission that the App asks for. A permission the App does not ask for yet cannot be accepted, and OuterLayer must add it to the App first.
  • The installation does not include the repository.
  • The repository’s default branch does not require a pull request. See Protect the default branch.
Builds need contents, pull requests and issues write, and actions, checks, commit statuses and metadata read. A permission held at read does not count where write is needed. doctor only reads. It changes nothing on GitHub or in your factory.

Build tokens

For a build, OuterLayer issues GitHub tokens through the App. Each token covers one repository and lasts about an hour. These rules limit who gets a token:
  • Only the key that holds the item’s live claim gets one.
  • A member of your organization must have asked for the build. A build that OuterLayer starts for the factory is the exception, such as one that resolves a merge conflict.
  • The token of a schedule automation’s run is read-only. It covers the one repository the run reads. It can read the files, the workflow runs and the GitHub checks of that repository.
The rules, the request and every refusal are in Repository tokens. In a container or microVM build, the runner asks for the tokens and revokes them when the attempt ends. The build can read the read token, which gh uses. The build never holds the push token: the runner adds it to a push it forwards. See the git remote and the build’s tokens. A build that runs with hooks of your own fetches and pushes with the GitHub login already on the host. Every runner build still opens its pull request as the App. See Opening the pull request.

What OuterLayer records about a token

For every token it issues, OuterLayer records which claim, repository, access and key it was for, and the permissions it asked GitHub for. It also writes a Repository token issued event to the organization audit log. It never stores the token.

Who a build’s commits are authored by

Every commit a runner build makes is authored by the App’s bot account, <app-slug>[bot]. The member who asked for the build is its co-author when that member signed in to OuterLayer with GitHub. The co-author line uses the member’s GitHub noreply address, so the commit counts on their GitHub profile. A member who signed in another way is not named, and the commit has no co-author. No personal email address is written into a commit.

User authorization

When you post a review from the dashboard, OuterLayer posts it on GitHub as you. You connect your GitHub account once and authorize the App on GitHub. See What GitHub receives. An access token lasts 8 hours. OuterLayer renews it with a refresh token that lasts about 6 months. OuterLayer stores both tokens encrypted and never shows them. The App needs no extra permission, because Pull requests is already Read and write.

Letting a build change workflows

A build cannot change files under .github/workflows/ unless a member allows it for that repository.
A changed workflow can run with the repository’s CI secrets when the build pushes its branch. This happens before anyone reviews the pull request. Turn the switch on only when builds must change workflow files.
  1. In the factory, open Settings → Repositories.
  2. On the repository’s row, turn on Let builds change GitHub workflows.
Each linked repository has its own switch, and each switch starts off. Changing it needs the Reconfigure the git connection permission. Each change writes a Repository setting changed event to the organization audit log, with the old and the new value. While the switch is on, each push token for that repository can also write workflows. OuterLayer stores the switch in your factory, not in the repository, so a build cannot turn it on.

Protect the default branch

In a container or microVM build, the runner forwards a push only to the branch the claim names. The build never holds the push token. The token itself can write to any branch of the item’s repository, and a push runs that repository’s CI. Two settings keep a build that gets past the runner from reaching further than its own branch:
  • Require a pull request before merging on the default branch. Use a ruleset with the Require a pull request before merging rule, or classic branch protection with required reviews. A build then cannot push to the default branch directly. Its change lands only through a pull request someone approves.
  • Keep CI secrets in protected environments. Keep deployment keys and other secrets in a GitHub environment. Limit its deployment branches to the default branch. Name the environment in each workflow job that needs the secrets. A workflow run on a build’s branch then gets no secret it could print or send.
outerlayer doctor warns about a default branch that requires no pull request. It can read rulesets. It cannot read classic branch protection, because the App does not ask for the Administration permission. So for a branch protected the classic way, doctor says it cannot tell whether the branch requires a pull request.