From 6887f00c6baeeebfbfabab315fdcf68a77c42ffd Mon Sep 17 00:00:00 2001 From: Amin Yahyaabadi Date: Sat, 30 Mar 2024 03:20:15 -0700 Subject: [PATCH] ci: validate the dist folder --- .github/workflows/check-dist.yml | 36 ++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 .github/workflows/check-dist.yml diff --git a/.github/workflows/check-dist.yml b/.github/workflows/check-dist.yml new file mode 100644 index 0000000..265aa1b --- /dev/null +++ b/.github/workflows/check-dist.yml @@ -0,0 +1,36 @@ +name: Check Dist + +on: + pull_request: + push: + +permissions: + contents: read + +jobs: + check-dist: + name: Check dist/ + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-node@v4 + with: + node-version: 20 + + - uses: pnpm/action-setup@v3 + with: + version: 8 + + - name: Install and Build + run: pnpm i + + - name: Validate Dist + id: diff + run: | + if [ "$(git diff --ignore-space-at-eol --text dist/ | wc -l)" -gt "0" ]; then + echo "Detected uncommitted changes after build. See status below:" + git diff --ignore-space-at-eol --text dist/ + exit 1 + fi