You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This action runs dist/index.js (see action.yml), which is a bundle of src/ and all runtime dependencies produced by ncc.
However, nothing in CI verifies that the committed dist/ is in sync with src/, package.json, and package-lock.json.
As a result, dependency updates can be merged without the bundle being rebuilt, and the changes never reach users.
The existing pr-test.yml workflow does not catch this, because it runs npm run build before uses: ./, so it tests a fresh build rather than the committed dist/.
Proposal
Add a CI job that rebuilds dist/ and fails if the result differs from the committed one.
name: Check diston:
pull_request:
branches: [ main ]push:
branches: [ main ]jobs:
check-dist:
runs-on: ubuntu-lateststeps:
- uses: actions/checkout@v7
- uses: actions/setup-node@v7with:
node-version: '20'cache: 'npm'
- run: npm ci
- run: npm run build
- name: Compare dist/run: | if [ -n "$(git status --porcelain dist/)" ]; then echo "dist/ is out of date. Please run 'npm ci && npm run build' and commit the result." # we need to detect new files, so use `git status --porcelain` instead of `git diff --exit-code` git status --porcelain dist/ git diff --stat dist/ exit 1 fi
Tasks
Confirm a clean rebuild of main (after the follow-up rebuild PR) yields no diff
Add check-dist workflow
Add check-dist as a required status check
Decide and document how Dependabot PRs get dist/ rebuilt
Activity