Connecting GitHub to your Turtini org

Connecting GitHub lets your org export Builder sites to a GitHub repository you own — static HTML, CSS, and assets, committed in a single atomic commit on main, ready to host anywhere or use as a snapshot of what was published. Module data (CRM, accounting, etc.) stays in Turtini and is never written to the repo.

To connect:
1. Go to Settings → Integrations → GitHub
2. Pick the scope you want Turtini to ask for:
• Public repos only (default) — Turtini can read and push to your public repos. Recommended for marketing sites.
• Public + private repos — required if you want to export to a private repo.
3. Click "Connect with GitHub" — a popup opens GitHub's authorization screen
4. Click "Authorize Turtini" on GitHub
5. The popup closes automatically and the panel shows your GitHub username, avatar, and granted scope

Only org owners and admins can connect, disconnect, or change the scope. Members see status only.

What Turtini does with the connection:
• Stores an encrypted OAuth token at the org level — never sent back to the browser after save
• Uses the token only when YOU click "Export" on a site, or when auto-export-on-publish fires
• Lists repos you own when you pick a target for an export
• Creates the repo for you (private or public, your choice) on first export if you don't pick an existing one
• Pushes a single atomic commit on main via the Git Trees API — no branch noise, no force-pushes, no rebases

Disconnecting:
Revokes Turtini's stored token. Sites that were already exported stay in their repo untouched. To break the link from the GitHub side too, revoke the OAuth app at github.com/settings/applications.

Common errors:
• "Popup was blocked" — allow popups for this site and click Connect again
• "GitHub blocks sign-in from embedded browsers" — open Turtini in your regular browser (Safari, Chrome, Firefox); GitHub OAuth doesn't work inside iframes or app webviews
• "Action required" / token expired — happens if you revoke the app on GitHub's side. Click Connect again to re-authorize.

Related:
• "Exporting a Builder site to GitHub" — the actual export flow + auto-export-on-publish
• Phase 2 (Runbooks export) and Phase 3 (pull-to-host) are on the roadmap; today's surface is Builder sites only.