Connect GitHub to a workspace
Agents clone, push and open pull requests through the Spotlight GitHub App. To install it you need to be an owner or admin of the Spotlight workspace, and on GitHub either an admin of the organisation you install on or the owner of the personal account. The connection covers the whole workspace, though you start it from a team's settings, and one installation connects to one workspace.
Install the App
Open Settings from the workspace menu, then Integrations under your team's name.
On the GitHub row, select Install on GitHub.
On GitHub, pick the organisation or account to install on.
Choose the repositories Spotlight may work in: all of them, or only the ones you select. Then install.
Finish on Spotlight
GitHub sends you back to Spotlight, which shows Connecting the App to your
workspace… and then returns you to the page you started from. The GitHub row
now reads Can access <n> repositories, or Can access 1 repository. While the list
loads, it reads Works in this team's repositories.
If the page shows Approval requested, you are not an admin of that organisation, so GitHub sent the organisation's owners a request instead of installing. Ask one of them to approve it on GitHub. Once it is approved, a person who is both an admin of the organisation and an owner or admin of the workspace selects Install on GitHub again and finishes on GitHub. Spotlight connects the installation when GitHub sends them back.
If the page shows Sorry, the GitHub App couldn't connect, the connection was denied. Check that:
- you are an owner or admin of the workspace,
- you are an admin of the installation on GitHub,
- the installation is not already connected to another workspace.
Then select Back to the team's integrations and install again. If all of those are true, sign in to Spotlight again and retry: the connection is also denied when GitHub will not say whether you are an admin of the installation.
Change the repositories later
Select the GitHub row, then Manage on GitHub. Add or remove repositories there. Uninstalling the App on GitHub disconnects the workspace.
Let the App set repository variables
The setup chat sets the GitHub Actions variables SPOTLIGHT_URL,
SPOTLIGHT_PLAN_TRUST and SPOTLIGHT_APPLY_TRUST of the configuration
repository if the App has the repository permission
Variables: read and write. The permission is optional. Without it, nothing
fails: the setup pull request lists the variables for you to add. See
Let the agent write your team's first Terraform.
On a self-hosted Spotlight, give your GitHub App this permission under Permissions & events, then accept the new permission on each installation.
Let the App read failed checks
The App receives failed check suites, and the checks
tool reads them, with the repository permission Checks: read. With the
permission Actions: read too, the tool also gives the failed step and the
log of each GitHub Actions job. Without it, step and log are null.
On a self-hosted Spotlight, give your GitHub App these permissions under Permissions & events, and select the Check suite event under Subscribe to events. Without the event, Spotlight receives no failed check suites. Then accept the new permissions on each installation.
Related
- Point a line at your repositories
- Have Spotlight review pull requests
- GitHub events: what Spotlight receives from GitHub.