GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||||||||
GeezerVison is showing github.com — Use CI friendly commands in documentation by jonkoops · Pull Request #326 · actions/setup-node Conversation
|
|
@dmitry-shibanov Anything blocking this from getting merged? |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
+1 |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| cache: 'npm' | ||
| cache-dependency-path: '**/package-lock.json' | ||
| - run: npm install | ||
| - run: npm ci |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Does it make sense to use npm ci when the dependencies are being restored from a cache?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
I believe the cache option only caches the global cache, not the node_modules directory. So it still makes sense.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
It does look like it's running npm config get cache to get the path to cache, so that does make sense, thanks 👍
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@dmitry-shibanov @brcrista @marko-zivic-93 is there any interest in getting this merged? |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Hello @jonkoops. Thank you for your pull request. I think we can adjust these changes when caching is enabled, because it relies on hash from dependency files. For other cases I think we should leave it as |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
I think differently about this matter, checking in lockfiles is considered best practice for all package managers. Instead of appeasing users that might not have checked this file in we should encourage them to follow these practices. For example, the NPM documentation says the following about the
All of these points apply directly to Github and Github Actions and I believe that these best practices should be reflected here as well. I propose that all commands are replaced with their appropriate CI friendly versions as per the original purpose of this PR and that the documentation is amended to have a dedicated section to lockfiles. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Replaces `npm install` with `npm ci` command and adds the `--frozen-lockfile` flag for Yarn and PNPM installation commands.
|
I've added some documentation about lockfiles as mentioned above. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
For an official action like this, I think it's important to use examples that adopt best practices. There are many beginners that read these examples that are not aware of the trade-offs between The problem with using For example, a new dependency update that satisfies the
|
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Thank you @jonkoops for improving the documentation and your work. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Thanks for taking this into consideration and merging it! |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.