Export Figma Variables - Design Tokens [Global]--Primitive Colors #12
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }} |