From 97268e8e04492dfb9485bb322e15227cc8474f89 Mon Sep 17 00:00:00 2001 From: Aaron Paterson Date: Wed, 19 Apr 2023 01:37:11 -0600 Subject: [PATCH 1/3] use git diff --cached in diff check action ensures every build difference is in the diff --- .github/workflows/check-dist.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/check-dist.yml b/.github/workflows/check-dist.yml index 99c1f04..45cfdd3 100644 --- a/.github/workflows/check-dist.yml +++ b/.github/workflows/check-dist.yml @@ -38,9 +38,9 @@ jobs: - name: Compare the expected and actual dist/ directories run: | - if [ "$(git diff --ignore-space-at-eol dist/ | wc -l)" -gt "0" ]; then + if [ "$(git diff --cached --ignore-space-at-eol dist/ | wc -l)" -gt "0" ]; then echo "Detected uncommitted changes after build. See status below:" - git diff + git diff --cached --ignore-space-at-eol dist/ exit 1 fi id: diff From 3c3cfe66ad6c7b372af292a7567668e90229b1ef Mon Sep 17 00:00:00 2001 From: Aaron Paterson Date: Wed, 19 Apr 2023 10:08:25 -0600 Subject: [PATCH 2/3] git add -N and no --cached --- .github/workflows/check-dist.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/check-dist.yml b/.github/workflows/check-dist.yml index 45cfdd3..e567302 100644 --- a/.github/workflows/check-dist.yml +++ b/.github/workflows/check-dist.yml @@ -38,9 +38,10 @@ jobs: - name: Compare the expected and actual dist/ directories run: | - if [ "$(git diff --cached --ignore-space-at-eol dist/ | wc -l)" -gt "0" ]; then + git add -N . + if [ "$(git diff --ignore-space-at-eol dist/ | wc -l)" -gt "0" ]; then echo "Detected uncommitted changes after build. See status below:" - git diff --cached --ignore-space-at-eol dist/ + git diff --ignore-space-at-eol dist/ exit 1 fi id: diff From 1515868b93271d05a28942337c184e3c6776b1c3 Mon Sep 17 00:00:00 2001 From: Aaron Paterson Date: Wed, 19 Apr 2023 10:10:31 -0600 Subject: [PATCH 3/3] Update check-dist.yml --- .github/workflows/check-dist.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/check-dist.yml b/.github/workflows/check-dist.yml index e567302..2bc1047 100644 --- a/.github/workflows/check-dist.yml +++ b/.github/workflows/check-dist.yml @@ -38,7 +38,7 @@ jobs: - name: Compare the expected and actual dist/ directories run: | - git add -N . + git add -N dist/ if [ "$(git diff --ignore-space-at-eol dist/ | wc -l)" -gt "0" ]; then echo "Detected uncommitted changes after build. See status below:" git diff --ignore-space-at-eol dist/