Skip to content

feat: add action for creating PR on tokens sync #3

feat: add action for creating PR on tokens sync

feat: add action for creating PR on tokens sync #3

name: Update Design Tokens
on:
push:
# this branch must be the same as configured in figma tokensbrücke plugin for export.
branches: [tokens-sync]
env:
CI: true
jobs:
create-pr:
runs-on: macos-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version-file: ".node-version"
cache: "npm"
- name: Install Dependencies
run: npm ci
- name: Create changeset
# hardcode the changeset file, because the CLI doesn't allow to pass all arguments
# and relies on interactive shell usage.
run: >
cat << EOM --- "@holisticon/hap-foundation": patch ---
Updated design tokens EOM > .changeset/update-tokens.md EOM
- name: Create Pull Request
uses: peter-evans/create-pull-request@v7
with:
commit-message: "chore: update design tokens"
title: Update Design Tokens
body: Update design tokens from figma
branch: tokens-sync