-
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
Provide a output for the selected Node.js version #150
Comments
There's a workaround for this in the meantime: - name: Get NodeJS Version
id: nodeversion
run: |
echo "::set-output name=version::$(node --version)" Then in the future steps you can call it I only adapted this from another workflow which calls a different command, but this should work for what you are doing. Just put this after |
I don't think it even needs to be an output. On the target side (which would read the output for this proposal) simply do a $(node --version) to compose the key. Writing an output and executing a graph of jobs is fragile because reading the cache shouldn't be based on the previous jobs node version, it should be based on the node version in the job that's consuming the cached node-modules. |
Thanks for responding @bryanmacfarlane! I've been happily using @kennethtran93's suggestion but I don't fully follow — I agree that's the ideal in situations when you're writing a shell script, but is it possible to do the call to I'm using this to do the opposite of your example — based on the Node version (and the system + hashed (Not to suggest every |
I just stumbled upon this issue while figuring out how to recall cached node_modules with the cache key containing the node version.
@bryanmacfarlane How would you suggest to change the key attribute to use |
See #173 |
So are we stuck having to have this extra step everywhere? Why is this present in setup-python but for setup-node it's lack of is as-designed? 🙏 #173 |
I was looking here also to see if there was a succinct way to get the node version for convenience, but is there some reason why the
|
@simondotm The devil is in the details of how you’re trying to use the Node version so that may be good enough in some cases, but using I’ll again note that |
#173 implements this. |
|
* feat(pull_strategy): add `NO-PULL` option * fix: add additional NO-PULL debug log
It would be great if there could be an output that tells which exact version of Node.js was installed.
An example use case for this is cacheing
node_modules
, which is only valid for the same OS + Node.js version + package-lock combination:The text was updated successfully, but these errors were encountered: