Skip to content

Commit 0788de7

Browse files
committed
ci: check dist bundles against fresh build instead of git history
1 parent 7a6f90c commit 0788de7

File tree

1 file changed

+8
-14
lines changed

1 file changed

+8
-14
lines changed

.github/workflows/ci.yml

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -54,22 +54,16 @@ jobs:
5454
run: npm run lint
5555

5656
- name: Check dist bundles
57-
if: matrix.os == 'ubuntu-latest' && github.event_name == 'pull_request'
57+
if: matrix.os == 'ubuntu-latest'
5858
run: |
59-
# Get files changed in this PR
60-
git fetch origin ${{ github.base_ref }} --depth=1
61-
changed_files=$(git diff --name-only origin/${{ github.base_ref }}...HEAD)
62-
63-
# Check for source and dist changes
64-
source_changed=$(echo "$changed_files" | grep -E '\.ts$' || true)
65-
dist_changed=$(echo "$changed_files" | grep -E '/dist/' || true)
66-
67-
if [ -n "$source_changed" ] && [ -z "$dist_changed" ]; then
68-
echo "::warning::Source files changed but no dist/ files were updated. Run 'npm run build' and commit the updated dist/ files."
69-
echo "Changed source files:"
70-
echo "$source_changed"
71-
else
59+
# npm install already ran prepare (which rebuilds all workspaces).
60+
# If any dist/ file differs from what is committed, the bundle is stale.
61+
if git diff --quiet -- '*/dist/'; then
7262
echo "Dist bundle check passed"
63+
else
64+
echo "::warning::dist/ files are out of date. Run 'npm run build' and commit the updated dist/ files."
65+
echo "Out-of-date files:"
66+
git diff --name-only -- '*/dist/'
7367
fi
7468
7569
# ===========================================================================

0 commit comments

Comments
 (0)