Skip to content

Commit

Permalink
Refining
Browse files Browse the repository at this point in the history
  • Loading branch information
TimRoe committed Dec 16, 2023
1 parent 57b5bc4 commit b8897cf
Showing 1 changed file with 10 additions and 23 deletions.
33 changes: 10 additions & 23 deletions .github/workflows/tokens-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

0 comments on commit b8897cf

Please sign in to comment.