-
Notifications
You must be signed in to change notification settings - Fork 2
46 lines (39 loc) · 1.18 KB
/
build-themes.yaml
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
name: Build Themes
on:
workflow_dispatch:
push:
branches:
- 'figma-tokens'
paths:
- 'styles/src/tokens.json'
jobs:
build-themes:
runs-on: ubuntu-latest
permissions:
pull-requests: write
contents: write
steps:
- name: Checkout Repository
uses: actions/checkout@v2
with:
fetch-depth: 2
- name: Setup Node
uses: actions/setup-node@v2
with:
node-version: '16'
- name: Install dependencies
run: npm install
- name: Build themes
run: yarn build:themes
- uses: EndBug/add-and-commit@v7
with:
add: ./styles/dist
message: 'Update themes from token file'
default_author: github_actions
- name: Create PR if it doesn't exist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
if [[ $(gh pr list --json "url" -q ".[].url" --head figma-tokens | wc -c) -eq 0 ]]; then
gh pr create --base master --head figma-tokens --title "Autogenerate themes from new tokens" --body "This PR is generated by 'build-themes.yaml' when new changes are made to tokens.json"
fi