diff --git a/.github/workflows/check-dist.yml b/.github/workflows/check-dist.yml index e521b6f..001a5d7 100644 --- a/.github/workflows/check-dist.yml +++ b/.github/workflows/check-dist.yml @@ -1,8 +1,3 @@ -# `dist/index.js` is a special file in Actions. -# When you reference an action with `uses:` in a workflow, -# `index.js` is the code that will run. -# For our project, we generate this file through a build process from other source files. -# We need to make sure the checked-in `index.js` actually matches what we expect it to be. name: Check dist/ on: @@ -31,23 +26,29 @@ jobs: - name: Install dependencies run: pnpm install - - name: Rebuild the dist/ directory + - name: Rebuild the dist/ directories run: | pnpm run -r build pnpm run -r package - name: Compare the expected and actual dist/ directories run: | - if [ "$(git diff --ignore-space-at-eol dist/ | wc -l)" -gt "0" ]; then - echo "Detected uncommitted changes after build. See status below:" - git diff - exit 1 - fi + directories=("actions/deploy/dist" "actions/pull-request-diff/dist") # Add or remove directories as necessary + for dir in "${directories[@]}"; do + if [ "$(git diff --ignore-space-at-eol $dir | wc -l)" -gt "0" ]; then + echo "Detected uncommitted changes in $dir after build. See status below:" + git diff $dir + exit 1 + fi + done id: diff - # If index.js was different than expected, upload the expected version as an artifact - - uses: actions/upload-artifact@v3 + # If index.js was different than expected, upload the expected versions as artifacts + - name: Upload artifacts + uses: actions/upload-artifact@v3 if: ${{ failure() && steps.diff.conclusion == 'failure' }} with: name: dist - path: dist/ + path: | + actions/deploy/dist + actions/pull-request-diff/dist