From 0becada2758ea0397ec8925af471b9755dfad033 Mon Sep 17 00:00:00 2001 From: Brian Cristante <33549821+brcrista@users.noreply.github.com> Date: Thu, 5 Aug 2021 14:49:15 -0400 Subject: [PATCH] Don't need to mv the file before git diff --- .github/workflows/check-dist.yml | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/.github/workflows/check-dist.yml b/.github/workflows/check-dist.yml index a19cd7a..16c2117 100644 --- a/.github/workflows/check-dist.yml +++ b/.github/workflows/check-dist.yml @@ -32,14 +32,16 @@ jobs: - name: Install dependencies run: npm ci - - name: Move the committed index.js file - run: mv dist/ /tmp/ - - - name: Rebuild the index.js file + - name: Rebuild the dist/ directory run: npm run build - - name: Compare the expected and actual index.js files - run: git diff --ignore-all-space dist/ /tmp/dist + - 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 id: diff # If index.js was different than expected, upload the expected version as an artifact