From 8194f3acf061bb61412cf10b06ae27c7c51b9bec Mon Sep 17 00:00:00 2001 From: Lukas Taake Date: Fri, 15 Nov 2024 17:45:28 +0100 Subject: [PATCH] feat: add action for creating PR on tokens sync --- .github/workflows/update-tokens.yaml | 38 ++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 .github/workflows/update-tokens.yaml diff --git a/.github/workflows/update-tokens.yaml b/.github/workflows/update-tokens.yaml new file mode 100644 index 0000000..4764f03 --- /dev/null +++ b/.github/workflows/update-tokens.yaml @@ -0,0 +1,38 @@ +name: Update Design Tokens + +on: + push: + # this branch must be the same as configured in figma tokensbrücke plugin for export. + branches: [tokens-sync] + +env: + CI: true + +jobs: + create-pr: + runs-on: macos-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version-file: ".node-version" + cache: "npm" + - name: Install Dependencies + run: npm ci + - name: Create changeset + # hardcode the changeset file, because the CLI doesn't allow to pass all arguments + # and relies on interactive shell usage. + run: > + echo << EOM + --- "@holisticon/hap-foundation": patch --- + + Updated design tokens EOM > .changeset/update-tokens.md EOM + - name: Create Pull Request + uses: peter-evans/create-pull-request@v7 + with: + commit-message: "chore: update design tokens" + title: Update Design Tokens + body: Update design tokens from figma + branch: tokens-sync