Skip to content

Export Figma Variables - Design Tokens [Global]--Primitive Colors #12

Export Figma Variables - Design Tokens [Global]--Primitive Colors

Export Figma Variables - Design Tokens [Global]--Primitive Colors #12

Workflow file for this run

name: Build and Commit Design Tokens Changes
on:
pull_request:
types: [opened, reopened, synchronize]
paths:
- 'packages/design-tokens/tokens/**'
permissions:
contents: write
jobs:
build_and_commit:
name: Build and Commit
runs-on: ubuntu-latest
steps:
- name: πŸ— Setup repo
uses: pnpm/action-setup@v4
with:
version: 8
- name: πŸ— Checkout
uses: actions/checkout@v4
with:
# Check out the PR's head branch with full history
ref: ${{ github.event.pull_request.head.ref }}
repository: ${{ github.event.pull_request.head.repo.full_name }}
fetch-depth: 0 # Fetch all history for accurate merging
- name: πŸ— Setup Node
uses: actions/setup-node@v4
with:
node-version: 18
registry-url: 'https://registry.npmjs.org'
cache: 'pnpm'
- name: πŸ“¦ Install dependencies
run: pnpm install --frozen-lockfile
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: πŸ— Build Design Tokens
working-directory: ./packages/design-tokens
run: pnpm build
- name: πŸ” Run Checks
run: pnpm checks
- name: πŸ“ Commit Built Files
run: |
git config --global user.name 'UW Design Systems Bot'
git config --global user.email '[email protected]'
git add -A
if git diff-index --quiet HEAD --; then
echo "No changes to commit"
else
git commit -m 'Build design tokens output'
fi
- name: πŸš€ Push Changes
run: |
# Pull latest changes from the remote branch
git pull origin ${{ github.event.pull_request.head.ref }}
# Push your changes back to the PR's head branch
git push origin HEAD:${{ github.event.pull_request.head.ref }}