-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
No documented way to run without a lockfile #928
Comments
Oh, and I forgot, there is also this from the OSSF: https://github.com/ossf/package-manager-best-practices/blob/main/published/npm.md#project-types Maybe link out to these so folks can read documents from the experts in this space which will be updated as best practices change? |
Thank you for creating the issue! We will consider it and come back with a response! |
Hello @wesleytodd. The action has special input The cache is optional input and it is not enabled by default. |
Yep! I read those. That is different than what I am mentioning here. I am recommending that the unnecessarily (see links provided above) strong recommendations around lock files be removed and that there be top level documentation around running without a lockfile. I am happy to open PR's for these, but wanted to start the conversation as an issue before doing that work. |
Description:
According to your docs there is no way to disable the lockfile check. They repeatedly say it is recommended to use a lockfile:
https://github.com/actions/setup-node/blob/main/docs/advanced-usage.md#working-with-lockfiles
https://github.com/actions/setup-node?tab=readme-ov-file#checking-in-lockfiles
Unless I am missing it in some other docs I don't see it mentioned anywhere. But based on the code, it looks like you can avoid this check by disabling cache. I tested removing the
cache
key from my config and that did in fact work.First, I would recommend not being so forceful in your wording on these docs. There are many cases for libraries where a lockfile is not the best approach. Many bugs have been found by users because the library author did not test removing their lockfile before publishing and used outdated transitives when testing. If you like you could link to the documentation written by the Node.js Package Maintenance Working Group which outlines a bit of the tradeoffs.
Short of that, I think an addition should be made to the advanced topics about turning off cache so that you can run without a lockfile.
The text was updated successfully, but these errors were encountered: