Skip to content

Connect a repo

import { Steps } from ‘@astrojs/starlight/components’;

A SQLAnvil Cloud project is backed by a GitHub repository — the one holding your .sqlx files and workflow_settings.yaml. Connecting it is how Cloud reads your project to compile and run it, and how it receives pull-request events for branch CI.

Connecting goes through the SQLAnvil GitHub App, so the connection is verified — Cloud only ever sees repositories you’ve explicitly granted it, and it uses short-lived installation tokens rather than a stored personal access token.

These are two separate things, and you’ll touch both:

  • Sign in with GitHub authenticates you (identity only).
  • The GitHub App grants Cloud scoped access to specific repositories (read contents, write PR checks) and delivers pull-request webhooks. You install it once per account/org and choose which repos it can see.
  1. In a project, open the setup checklist and choose Connect a repo.

  2. If you haven’t installed the app yet, click Install SQLAnvil on GitHub. GitHub asks which account/org and which repositories to grant — pick “only select repositories” and choose the one holding your SQLAnvil project (you can add more later).

  3. You’re returned to the project. Connect a repo now shows a dropdown of the repositories the app can access. Pick one and click Connect.

The project now shows a verified repo connection. You can change it anytime from Settings → Repo.

The app requests the minimum it needs:

  • Contents: read — to clone and compile your project.
  • Pull requests / Checks: write — to post the “SQLAnvil CI” status on a PR.
  • Metadata: read — required by all GitHub Apps.

It has no write access to your code and can only see the repositories you selected at install time. Revoke or adjust access anytime from your GitHub account’s Settings → Applications → Installed GitHub Apps.

Once the repo and your Supabase warehouse are connected, opening a pull request creates a SQLAnvil run: SQLAnvil branches your Supabase project, runs the workflow against that ephemeral branch, and posts a “SQLAnvil CI” check back to the PR (visible in the dashboard with full run detail). For Postgres/BigQuery/MySQL, run execution in your own CI and report with the ingest token instead.