-
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.
- Loading branch information
Showing
1 changed file
with
10 additions
and
23 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 |
---|---|---|
|
@@ -10,17 +10,11 @@ on: | |
- main | ||
|
||
env: | ||
FILES_MODIFIED: | ||
FIGMA_FILES_CHANGED: | ||
|
||
jobs: | ||
tokens-build: | ||
name: Build (fails by design) | ||
# id: tokens-build | ||
runs-on: ubuntu-latest | ||
# continue-on-error: true | ||
# outputs: | ||
# figma-noDiff: steps.noDiff.outputs.test | ||
# figma-built: steps.built.output.test | ||
steps: | ||
- name: Checkout repo | ||
uses: actions/checkout@v4 | ||
|
@@ -36,37 +30,30 @@ jobs: | |
cache-dependency-path: yarn.lock | ||
- run: yarn install | ||
- name: Build tokens | ||
run: | | ||
yarn tokens:build | ||
run: yarn tokens:build | ||
- name: Prepare commit | ||
working-directory: packages/tokens | ||
run: | | ||
git config --global user.name 'VA Automation Bot' | ||
git config --global user.email '[email protected]' | ||
git pull | ||
git add -f figma/ | ||
git status --porcelain 2>/dev/null| egrep "^(A| A|M| M|D| D)" | wc -l | ||
- name: Check figma diff | ||
id: diff | ||
- name: Check for `figma` diff | ||
working-directory: packages/tokens | ||
run: | | ||
echo $FILES_MODIFIED | ||
git status --porcelain 2>/dev/null| egrep "^(A| A|M| M|D| D)" | wc -l | ||
echo "FILES_MODIFIED=$(git status --porcelain 2>/dev/null| egrep "^(A| A|M| M|D| D)" | wc -l)" >> $GITHUB_ENV | ||
echo $FIGMA_FILES_CHANGED | ||
git status figma --porcelain 2>/dev/null| egrep "^(A| A|M| M|D| D)" | wc -l | ||
echo "FIGMA_FILES_CHANGED=$(git status figma --porcelain 2>/dev/null| egrep "^(A| A|M| M|D| D)" | wc -l)" >> $GITHUB_ENV | ||
- name: No changes to figma tokens | ||
if: ${{ env.FILES_MODIFIED == '0' }} | ||
if: ${{ env.FIGMA_FILES_CHANGED == 0 }} | ||
run: | | ||
echo $FILES_MODIFIED | ||
echo $FIGMA_FILES_CHANGED | ||
echo No changes to figma tokens | ||
- name: Commit latest figma tokens | ||
id: built | ||
if: ${{ env.FILES_MODIFIED == '1' }} | ||
if: ${{ env.FIGMA_FILES_CHANGED >= 1 }} | ||
working-directory: packages/tokens | ||
run: | | ||
echo $FILES_MODIFIED | ||
echo $FIGMA_FILES_CHANGED | ||
exit 1 | ||
git commit -m 'Build latest figma tokens' | ||
git push | ||
- name: Set success/fail | ||
if: ${{ env.FILES_MODIFIED >= '2' }} | ||
run: fail 1 |