Should the check-dist.yml workflow delete the dist/ directory before it performs the build (possibly even before npm ci / directly after actions/checkout))?
Rationale:
dist/ should be regenerated anyway
- it avoids issues in case
dist/ contains stale files which are not cleaned up by npm run bundle
Let's say there is dist/not-used-anymore.js which is not actually produced anymore by npm run bundle. Then check-dist might erroneously not notice this.
- it reduces the risk that (malicious?) files in
dist/ can in some way influence the build process and make check-dist erroneously succeed
(not sure how realistic that is)
What do you think? Maybe some of these points are not an issue specifically for this typescript-action template, but could be a problem if users have a modified build setup?