Skip to content

Commit 3ce21f0

Browse files
fix: ensure dist is up to date
1 parent 9862478 commit 3ce21f0

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

.github/workflows/build.yml

+16
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,22 @@ jobs:
101101
run: |
102102
npm run build
103103
104+
- name: Compare the expected and actual dist/ directories
105+
id: diff
106+
run: |
107+
if [ "$(git diff --ignore-space-at-eol dist/ | wc -l)" -gt "0" ]; then
108+
echo "Detected uncommitted changes after build. See status below:"
109+
git diff
110+
exit 1
111+
fi
112+
113+
# If dist/ was different than expected, upload the expected version as an artifact
114+
- uses: actions/upload-artifact@v2
115+
if: ${{ failure() && steps.diff.conclusion == 'failure' }}
116+
with:
117+
name: dist
118+
path: dist/
119+
104120
npm-lint:
105121
name: Lint the code
106122
runs-on: ubuntu-latest

0 commit comments

Comments
 (0)