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
- In Basemode, open Connections and choose GitHub. The link opens GitHub's fine-grained token page with the name and permissions filled in.
- Under Repository access, pick Only select repositories and choose the ones Basemode should update.
- Check the permissions: Contents: read and write, Pull requests: read and write, and Metadata: read, which GitHub adds for you.
- 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:
| Setting | Default | What it does |
|---|---|---|
| Repository | none | Where pull requests go, such as acme/web |
| Base branch | main | What changes are measured against and merged into |
| Folder | src/tokens | Where the generated files live |
| Formats | css | One or more of the 15 formats |
| Colors, units, prefix | hex, px, none | How values and names are written |
| Fix renamed references | on | Rewrite code that uses renamed tokens. See renames. |
| Schedule | off | Also 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.