-
Notifications
You must be signed in to change notification settings - Fork 82
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Local dir is not clean up properly before switching to target branch #59
Comments
Hiya! npm doesn't specify any behavior for So, while it would be too arbitrary for {
"scripts": {
- "postinstall": "patch-package && node ./patches/patch-xcode.js",
+ "postinstall": "lerna && patch-package && node ./patches/patch-xcode.js",
}
} This would apply to local installations in addition to CI, though. To fix this specifically in CI, you can tell jobs:
build:
name: Check
runs-on: ubuntu-latest
steps:
// <snip>
- uses: preactjs/compressed-size-action@7d87f60a6b0c7d193b8183ce859ed00b356ea92f # v2.1.0
with:
repo-token: '${{ secrets.GITHUB_TOKEN }}'
pattern: '{build/**/*.min.js,build/**/*.css}'
build-script: 'build:ci' ... then define {
"scripts": {
"build:ci": "npm run distclean && lerna && npm run build"
}
} (I believe the |
I feels wrong to have a command that destroys and re-creates Would you consider adding a configurable |
@scinos yes - that's a good idea! |
We found a scenario where this action is not completely cleaning up local directory before switching to the target branch, resulting in an invalid build:
Let's say I have a
master
branch that has a single dep, and two packages (one root, one nested):And then imagine I have a branch that updates
lib
dependency in my nested package, sonpm i
generates:So far so good. The above structure is valid and works without problems. However, when using this action it will essentially do (the build step is not important):
npm ci
master
npm ci
Running
npm ci
cleans./node_modules
, but it does not clean./packages/some-package/node_modules
(tested with npm 6.14.12), so when checking outmaster
there is still a leftover/packages/some-package/node_modules/[email protected]
present, and it is never clean up. The resulting combination may break and fail to compile (in fact, it did in WordPress/gutenberg#31476 (comment), where we found the issue).I think the solution would be to do a manual
rm -fr **/node_modules
before checking out the target branch.The text was updated successfully, but these errors were encountered: