diff --git a/.github/workflows/tokens-build.yml b/.github/workflows/tokens-build.yml index 1ac9db0a..c966306f 100644 --- a/.github/workflows/tokens-build.yml +++ b/.github/workflows/tokens-build.yml @@ -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,8 +30,7 @@ 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: | @@ -45,28 +38,22 @@ jobs: git config --global user.email 'va-mobileapp@adhocteam.us' 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 \ No newline at end of file