feat(workflows): add a build-tokens workflow #2
Workflow file for this run
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 Tokens | |
on: | |
pull_request: | |
types: [opened, synchronize, edited, reopened] | |
paths: | |
- 'packages/tokens/**' | |
jobs: | |
build: | |
name: Build Tokens | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup | |
uses: ./.github/actions/setup-pnpm | |
- name: Install tokens & dependencies | |
run: pnpm --filter design-system-tokens... install | |
- name: Build tokens & dependencies | |
run: pnpm --filter design-system-tokens... build | |
- name: Create Summary | |
id: summary | |
uses: actions/github-script@v7 | |
with: | |
script: | | |
const fs = require('fs') | |
const input = JSON.parse(fs.readFileSync('packages/tokens/tokenstudio-generated/tokens.json', 'utf8')) | |
return `# Build Tokens | |
- Input: | |
<pre>${JSON.stringify(input, null, 2)}</pre> | |
` | |
- name: Output Summary | |
run: echo -e ${{ steps.summary.outputs.result }} >> $GITHUB_STEP_SUMMARY |