-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(ci): add GitHub Actions workflow to rebuild DS tokens when token…
….json changes
- Loading branch information
Showing
1 changed file
with
44 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
name: 'build DS token when token.json file changes' | ||
|
||
on: | ||
push: | ||
paths: | ||
- 'packages/react/src/token/token.json' | ||
branches: [main] | ||
|
||
jobs: | ||
build-and-commit: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup Node.js | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: '18' | ||
cache: 'npm' | ||
|
||
- name: Install dependencies | ||
run: npm ci | ||
|
||
- name: Build tokens | ||
run: npm run build:token | ||
|
||
- name: Configure Git | ||
run: | | ||
git config --global user.name 'github-actions[bot]' | ||
git config --global user.email 'github-actions[bot]@users.noreply.github.com' | ||
- name: Commit and push if changes exist | ||
run: | | ||
if [[ -n "$(git status --porcelain)" ]]; then | ||
git add -A | ||
git commit -m "chore(ci): update design system tokens [skip ci]" | ||
git push | ||
else | ||
echo "No changes to commit" | ||
fi |