Start here

Connect GitHub

Second Shift reads your code through the Second Shift GitHub App, installed only on the repositories you choose. It uses short-lived tokens, so there is no long-lived access token to store or leak.

Install the app

  1. Start from the dashboard

    Open Projects (or Settings → Integrations → GitHub App) and click Connect GitHub.

  2. Choose the account and repositories

    GitHub asks where to install it: your personal account or an organization you own. Pick Only select repositories and choose the ones Second Shift should look after.

    If you are a member but not an owner of the organization, GitHub sends the owners a request to approve instead.

  3. Approve and come back

    Click Install & Authorize. GitHub returns you to the dashboard, where the account shows Connected.

  4. Add the repositories as projects

    Click Add repositories and tick the ones to add. A project is one product or service: if its code is in several repositories (for example a frontend, a backend and shared code), choose One project and name it; the first repository you tick is the main one. Otherwise A project each makes one project per repository. A project holds up to 5 repositories, and you can add more later with Add repository on the project.

    Then Index each project: indexing maps which files import which in each repository, so investigations can follow an error across your code.

What each permission is for

GitHub shows these on the install screen. Second Shift asks for the least it needs to read code and open pull requests.

PermissionWhy
Contents: read and writeRead the code an error points to, and push a fix to its own new branch. It never pushes to your default branch: a fix reaches main only when you merge its pull request.
Pull requests: read and writeOpen the fix as a pull request for your review, and notice when you merge it so the incident resolves.
Actions: readSee failed workflow runs, so a red CI run can open an incident.
Metadata: readRequired by GitHub for every app: repository names and basic details.
Keep your default branch protected
We recommend branch protection on main (require a pull request and a review). Second Shift works within it: every change arrives as a pull request from second-shift-agent[bot], with commits prefixed [second-shift].

How access works

  • Each time Second Shift reads code or opens a pull request, GitHub issues it a token that expires within an hour and works only on the repositories you selected.
  • For a fix, the repository is checked out into a temporary folder that is deleted afterwards. Git hooks in your repository never run.
  • Second Shift keeps the investigation and a map of your code structure, not a copy of your source. See Your data for exactly what is stored.

Change or remove access

  • Add or remove repositories: Change repositories next to the connected account opens the app’s settings on GitHub.
  • Disconnect: Disconnect stops Second Shift using that installation. Your projects stay.
  • Uninstall on GitHub: GitHub → Settings → Applications → Installed GitHub Apps → Second Shift Agent → Uninstall. GitHub tells Second Shift, and the account shows Uninstalled on GitHub.

If you can’t install apps

Some organizations don’t allow third-party apps. You can paste a fine-grained personal access token instead, underSettings → Integrations → Personal access token (advanced), with Contents and Pull requests set to read and write. Tokens are long-lived and tied to one person (they stop working when that person leaves), so prefer the app when you can.