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
- Start from the dashboard
Open
Projects(orSettings → Integrations → GitHub App) and clickConnect GitHub. - Choose the account and repositories
GitHub asks where to install it: your personal account or an organization you own. Pick
Only select repositoriesand 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.
- Approve and come back
Click
Install & Authorize. GitHub returns you to the dashboard, where the account showsConnected. - Add the repositories as projects
Click
Add repositoriesand 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), chooseOne projectand name it; the first repository you tick is the main one. OtherwiseA project eachmakes one project per repository. A project holds up to 5 repositories, and you can add more later withAdd repositoryon the project.Then
Indexeach 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.
| Permission | Why |
|---|---|
| Contents: read and write | Read 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 write | Open the fix as a pull request for your review, and notice when you merge it so the incident resolves. |
| Actions: read | See failed workflow runs, so a red CI run can open an incident. |
| Metadata: read | Required by GitHub for every app: repository names and basic details. |
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 repositoriesnext to the connected account opens the app’s settings on GitHub. - Disconnect:
Disconnectstops 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.