auto generate design tokens from data.json #1701
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: auto generate design tokens from data.json | |
on: | |
workflow_run: | |
workflows: | |
- Test codes | |
types: | |
- completed | |
env: | |
workdir: client | |
jobs: | |
run-style-dictionary: | |
runs-on: ubuntu-latest | |
if: contains(github.head_ref, 'auto/design-tokens') && github.event.workflow_run.conclusion == 'success' | |
permissions: | |
contents: 'write' | |
defaults: | |
run: | |
working-directory: ${{ env.workdir }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Install Dependencies | |
run: yarn install --immutable | |
- name: Add style-dictionary | |
run: yarn add -D style-dictionary | |
- name: run style-dictionary | |
run: yarn style-dictionary build | |
- name: Auto commit | |
if: steps.changes.outputs.client == 'true' | |
run: | | |
git config --global user.name "${GITHUB_ACTOR}" | |
git config --global user.email "${GITHUB_ACTOR}@users.noreply.github.com" | |
if (git diff --shortstat | grep '[0-9]'); then \ | |
git add .; \ | |
git commit -m "feat(front): update design tokens"; \ | |
git push origin HEAD:${GITHUB_REF}; \ | |
fi |