-
Notifications
You must be signed in to change notification settings - Fork 11
feat: Add DTCG tokens synced from Figma #350
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
RayRedGoose
wants to merge
12
commits into
main
Choose a base branch
from
figma-webhook
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+5,637
−3,347
Open
Changes from 4 commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
4797214
feat: Fix version for alpha
RayRedGoose 16d2d8a
chore: Release @workday/canvas-tokens-web v5.0.0-alpha.3 [ci skip]
RayRedGoose 3a67050
feat: Add DTCG tokens synced from figma
RayRedGoose c5b3a0b
Merge branch 'prerelease/major' into figma-webhook
RayRedGoose 38a74d8
fix: Remove raw tokens
RayRedGoose 7398253
fix: Update figma parser
RayRedGoose d5f187a
fix: Remove tokens
RayRedGoose 9d3bd0e
chore: Fix yarn
RayRedGoose 8bdc3af
fix: Fix versions
RayRedGoose 1e7e3a2
fix: Use root for default tokens
RayRedGoose 64f8f8c
chore: Update script
RayRedGoose e079bd9
chore: Fix package
RayRedGoose File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,105 @@ | ||
| name: Tokens Sync automation | ||
|
|
||
| on: | ||
| workflow_dispatch: | ||
| inputs: | ||
| toBranch: | ||
| description: 'Branch to sync tokens to' | ||
| required: true | ||
| default: main | ||
| type: choice | ||
| options: | ||
| - main | ||
| - prerelease/minor | ||
| - prerelease/major | ||
|
|
||
| jobs: | ||
| generate-icons: | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| packages: write | ||
| pull-requests: write | ||
| contents: write | ||
| env: | ||
| NODE_VERSION: 24.x | ||
|
|
||
| steps: | ||
| - name: Set target branch name | ||
| id: target-branch | ||
| run: echo "name=sync-tokens-from-figma-${{ inputs.toBranch }}" >> $GITHUB_OUTPUT | ||
|
|
||
| - name: Checkout code | ||
| uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 | ||
| with: | ||
| ref: ${{ inputs.toBranch }} | ||
|
|
||
| - name: Set global user | ||
| run: | | ||
| git config --global user.name "${{ github.actor }}" | ||
| git config --global user.email "${{ github.actor }}@users.noreply.github.com" | ||
|
|
||
| - name: Create branch | ||
| run: | | ||
| git checkout -b ${{ steps.target-branch.outputs.name }} | ||
|
|
||
| - uses: actions/setup-node@v7.0.0 | ||
| with: | ||
| node-version: ${{ env.NODE_VERSION }} | ||
|
|
||
|
RayRedGoose marked this conversation as resolved.
|
||
| - name: Cache node modules | ||
| id: yarn-cache | ||
| uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # 6.1.0 | ||
| with: | ||
| path: node_modules | ||
| key: ${{ runner.os }}-${{ env.NODE_VERSION }}-node-modules-hash-${{ hashFiles('yarn.lock') }} | ||
|
|
||
| - name: Install dev dependencies | ||
| if: steps.yarn-cache.outputs.cache-hit != 'true' | ||
| run: yarn install --production=false | ||
|
|
||
| - name: Fetch Figma variables | ||
| run: yarn fetch-tokens | ||
| env: | ||
| FIGMA_ACCESS_TOKEN: ${{ secrets.FIGMA_ACCESS_TOKEN }} | ||
| FIGMA_BASE_FILE_KEY: ${{ secrets.FIGMA_BASE_FILE_KEY }} | ||
| FIGMA_MAIN_FILE_KEY: ${{ secrets.FIGMA_MAIN_FILE_KEY }} | ||
|
|
||
| - name: Parse Figma variables | ||
| run: yarn parse-tokens | ||
|
|
||
| - name: Clear raw tokens | ||
| run: rm -rf figma-raw-tokens | ||
|
|
||
| - name: Check for token changes | ||
| id: changes | ||
| run: | | ||
| git add packages/canvas-tokens/dtcg/tokens | ||
| if git diff --cached --quiet; then | ||
| echo "No token changes found." | ||
| echo "has_changes=false" >> "$GITHUB_OUTPUT" | ||
| else | ||
| echo "Token changes found." | ||
| echo "has_changes=true" >> "$GITHUB_OUTPUT" | ||
| fi | ||
|
|
||
| - name: Commit changes | ||
| if: steps.changes.outputs.has_changes == 'true' | ||
| run: | | ||
| git commit -m "feat: Sync tokens from Figma" | ||
| git push origin ${{ steps.target-branch.outputs.name }} | ||
|
|
||
| - name: Create pull request | ||
| if: steps.changes.outputs.has_changes == 'true' | ||
| uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 | ||
| with: | ||
| github-token: ${{ secrets.GH_RW_TOKEN }} | ||
| script: | | ||
| github.rest.pulls.create({ | ||
|
|
||
| owner: 'Workday', | ||
| repo: 'canvas-tokens', | ||
| title: 'feat: Sync tokens from Figma', | ||
| head: '${{ steps.target-branch.outputs.name }}', | ||
| base: '${{ inputs.toBranch }}' | ||
| }); | ||
|
|
||
|
|
||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.