From ffb7396e8ecbfd525333083ad8479525cb12fc80 Mon Sep 17 00:00:00 2001
From: Brian Cristante <33549821+brcrista@users.noreply.github.com>
Date: Tue, 10 Aug 2021 10:28:46 -0400
Subject: [PATCH] Don't need to mv to git diff

---
 .github/workflows/check-dist.yml | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/.github/workflows/check-dist.yml b/.github/workflows/check-dist.yml
index 9fe1119..2377f93 100644
--- a/.github/workflows/check-dist.yml
+++ b/.github/workflows/check-dist.yml
@@ -32,15 +32,16 @@ jobs:
       - name: Install dependencies
         run: npm ci
 
-      - name: Move the committed index.js file
-        run: mv dist/index.js /tmp
-
       - name: Rebuild the index.js file
         run: npm run build
 
-      - name: Compare the expected and actual index.js files
-        run: git diff --ignore-all-space dist/index.js /tmp/index.js
-        id: diff
+      - 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
 
       # If index.js was different than expected, upload the expected version as an artifact
       - uses: actions/upload-artifact@v2