NewsThe Basemode plugin is now on Figma Community
Docs

Connect GitHub or GitLab

Where pull requests go, and what lands in them.

Basemode opens pull requests on GitHub and merge requests on GitLab.com. It works from a token you create, limited to the repositories you choose, and it never pushes to your main branch.

Connect GitHub

  1. In Basemode, open Connections and choose GitHub. The link opens GitHub's fine-grained token page with the name and permissions filled in.
  2. Under Repository access, pick Only select repositories and choose the ones Basemode should update.
  3. Check the permissions: Contents: read and write, Pull requests: read and write, and Metadata: read, which GitHub adds for you.
  4. Generate the token, paste it into Basemode, and give the connection a name.

Basemode encrypts the token and never shows it again. Anyone in your organization can see that the connection exists, not the secret.

Connect GitLab

Choose GitLab under Connections. The link opens GitLab's token page with the api scope filled in. A project or group access token with the same scope works too.

Point a design system at a repository

In the design system's Settings:

SettingDefaultWhat it does
RepositorynoneWhere pull requests go, such as acme/web
Base branchmainWhat changes are measured against and merged into
Foldersrc/tokensWhere the generated files live
FormatscssOne or more of the 15 formats
Colors, units, prefixhex, px, noneHow values and names are written
Fix renamed referencesonRewrite code that uses renamed tokens. See renames.
ScheduleoffAlso sync from Figma's API hourly or daily

What lands in the repository

Every sync commits to the basemode/tokens branch and opens one pull request, or updates the one already open. It contains:

  • The generated files, in your folder.
  • basemode.lock.json, which records what was generated so the next change can be measured against it.
  • Fixes in your code for renamed tokens, if that's on.
  • A description that leads with what could break: renames and removals first, then new and changed values.

If the generated files already match the base branch, no pull request is opened. A pull request someone closed stays closed until something actually changes.