Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 63 additions & 0 deletions .github/workflows/sync-figma-variables.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: Sync Figma Variables

on:
schedule:
- cron: "0 7,15 * * 1-5" # Weekdays at 09:00 and 17:00 UTC+2
workflow_dispatch: # Allow manual trigger from GitHub UI

concurrency:
group: sync-figma-variables
cancel-in-progress: true

permissions:
contents: write
pull-requests: write

jobs:
sync-variables:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: rc

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version-file: ".nvmrc"
cache: "npm"

- name: Install dependencies
run: npm ci

- name: Import Figma variables
env:
FIGMA_VARIABLE_TOKEN: ${{ secrets.FIGMA_VARIABLE_TOKEN }}
FIGMA_FILE_KEY: ${{ secrets.FIGMA_FILE_KEY }}
run: npx ts-node scripts/variable-exporter.ts

- name: Check for changes
id: changes
run: |
if git diff --quiet; then
echo "changed=false" >> "$GITHUB_OUTPUT"
else
echo "changed=true" >> "$GITHUB_OUTPUT"
fi

- name: Create Pull Request
if: steps.changes.outputs.changed == 'true'
uses: peter-evans/create-pull-request@v7
with:
branch: chore/sync-figma-variables
commit-message: "chore(variables): update variables from Figma #69"
title: "chore(variables): update variables from Figma"
body: |
## Summary
- Automated sync of variables from Figma variables API
- Run triggered by: ${{ github.event_name == 'schedule' && 'scheduler' || 'manual dispatch' }}

Review the diff to verify variable changes match what was updated in Figma.
base: rc
delete-branch: true