Getting Started

How to pull design tokens from several Specify repositories in GitHub

Learn how to sync your design tokens from several Specify repositories to GitHub

· 8 min read

This article will help you pull design tokens from several Specify repositories to your GitHub repository.

You could benefit from this if your need to implement Specify in your monorepo or if you want to pull design tokens from several repositories like a "Light Theme" or a "Dark Theme" one.

By default, The Specify GitHub App only works with a single .specifyrc.json at the root of your GitHub repository. A Specify configuration file can only pull design data from a single Specify repository.

The Specify CLI is more flexible and helps you use several Specify configuration files.

Prerequisites

Please make sure you have:

  • Several source Specify repositories containing your design tokens
  • A Specify Personal Access Token

The workflow

Our workflow is based on a GitHub Action that automatically pulls design tokens from Specify. If your Specify and your GitHub repositoy differ, a new PR will be opened containing your updated design tokens.

This workflow consists in 3 steps:

  1. Its installs the Specify CLI
  2. It pulls design tokens from several Specify repositories from the same example organization @acme-inc: General, Light-Theme and Dark-Theme
  3. It creates a Pull Request on a new branch called specify

How to use this workflow in GitHub

First, fork this GitHub repository that contains everything to help you get started.

Secondly, enable GitHub workflows in your GitHub repository.

Then, set a new repository secret called SPECIFY_TOKEN containing your Specify Personal Access Token in your GitHub repository: Settings > Secrets > Actions.

Finally, update the GitHub Action to set your own Specify repositories and Specify config files.

Now, test your workflow by executing it manually:

You should now see a new Pull Request created like so:

Going further

This article focuses on how to automatically run pull design data from several Specify repositoriesin GitHub. The Specify configurations we used may not generate what you're looking for.

Here are useful resources that will help you transform your design data:

More articles from the blog

Your brand.
Your products.
Always in sync.

Meet the design data platform you ever dreamt of.