Skip to content

Connect GitHub or GitLab

Updated

Quick answer

Create a token for only your website's repository (a GitHub fine-grained token with Contents and Pull requests read/write, or a GitLab project access token with the Developer role and api scope) and paste it with the repository name on Website Connection. Each approved change becomes one commit on its own branch and one pull or merge request; Sonnetpilot never merges.

Where
Website menu → Setup → Website Connection → Custom code → Connect your code on GitHub or GitLab
On this page

How to do it

  1. 1

    Create a token

    GitHub: Settings → Developer settings → Fine-grained tokens, for this repository only, with Contents and Pull requests read and write. GitLab: the project's Settings → Access tokens, Developer role, api scope.

  2. 2

    Paste it

    Enter the repository (owner/name or group/name), your GitLab address if it isn't gitlab.com, and the token.

  3. 3

    Approve a change

    Each approved change becomes a sonnetpilot/change-… branch with one commit and one pull or merge request into your default branch, or the branch you choose.

  4. 4

    Review, merge and deploy

    Review the diff and merge as usual. Sonnetpilot checks every hour and verifies the live page once it's merged and deployed.

Which files can be edited

  • Next.js app router files with export const metadata (the page first, then the layout).
  • Static HTML files (<title> and <meta name="description">).
  • Markdown front matter.

Only literal text values are edited. Titles built in code, such as generateMetadata, are left for a developer, and the change says so.

Cancelling and rolling back

Closing the pull or merge request cancels the change. An unmerged one can't be rolled back from Sonnetpilot: close it instead. Requests still unmerged after 14 days are recorded as “couldn't verify”.

Frequently asked questions

Does Sonnetpilot push to my main branch?

No. It always works on its own branch and opens a pull request (GitHub) or merge request (GitLab). It never pushes to your default branch and never merges.

Does it work with self-hosted GitLab?

Yes, a self-managed GitLab reached over HTTPS works the same way as gitlab.com.

Why was my change refused for a Next.js page?

The title is probably built in code, for example in generateMetadata. Sonnetpilot only edits literal values and leaves computed metadata for a developer.

Something unclear or out of date? Tell us and we'll fix the guide.