-
Notifications
You must be signed in to change notification settings - Fork 24
51 lines (47 loc) · 1.65 KB
/
sync-figma-to-tokens.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
name: Sync Figma variables to tokens
on:
workflow_dispatch:
inputs:
branch:
type: choice
description: Which branch to update
options:
- design-tokens-alpha
jobs:
sync-figma-to-tokens:
runs-on: ubuntu-latest
permissions:
# Need to be able to create new branches and commits
contents: write
pull-requests: write
steps:
- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: '18.18.0'
- name: Set NPM version
run: npm install -g [email protected]
- name: Clone repo
uses: actions/checkout@v3
- name: Install dependencies
run: yarn install
working-directory: design-tokens
- name: Sync variables in Figma file to tokens
run: yarn sync-figma-to-tokens -- --output tokens
working-directory: design-tokens
env:
FILE_KEY_PRIMITIVE: ${{ secrets.GH_ACTION_FIGMA_FILE_KEY_PRIMITIVE }}
FILE_KEY_SEMANTIC: ${{ secrets.GH_ACTION_FIGMA_FILE_KEY_SEMANTIC }}
FILE_KEY_COMPONENT: ${{ secrets.GH_ACTION_FIGMA_FILE_KEY_COMPONENT }}
PERSONAL_ACCESS_TOKEN: ${{ secrets.GH_ACTION_VARIABLES_SYNC_FIGMA_TOKEN }}
- name: Format token files with prettier
run: yarn prettier tokens --write
working-directory: design-tokens
- name: Create Pull Request
uses: peter-evans/create-pull-request@v5
with:
commit-message: Update tokens from Figma
title: Update tokens from Figma
body: 'Update tokens from Figma from tokens files'
base: ${{ github.event.inputs.branch }}
branch: update-tokens