Start connecting a GitHub organization
Returns the url of GitHub’s sign-in page for the offstage app, and sets a cookie holding a signed state that names this team and the signed-in owner, good for 30 minutes. GitHub sends the browser back to /v1/github/setup on the console with a code; the plane learns from it who the person is on GitHub (their token is revoked at once, never kept) and links each organization installation of the app whose organization has them as an admin (an owner) and no offstage team has yet. With none, the browser goes on to GitHub’s install page, and installing there brings it back the same way. The setup route checks GitHub’s redirect against the cookie, so only the browser that started connecting can finish it, and redirects to /ci?connected=<accounts> or to /ci?github_error=<code>: not-org-admin (not an admin of the organization), authorization-needed (no code, declined, or expired), installation-linked-elsewhere, state-expired, bad-state, wrong-team, signed-out, owner-only, install-requested (a non-owner asked an organization owner to approve), no-such-installation, github-error, github-unreachable. Owners only, on a personal team or an organization. Console session only: an API key gets 403 console-only.