-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Added Node version to cache key #1172
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
Conversation
textbook
commented
Jan 12, 2025
Shouldn't this use the actual major Node version in the cache key? The linked issue says:
The major version number, (e.g., 22 in 22.12) should be used to avoid unnecessary invalidation when upgrading to patch or minor versions.
That makes sense to me. But the implementation here uses version
, which is either core.getInput("node-version")
(any supported version) or whatever was pulled from the node-version-file
. This could be a major version, but equally could be a minor or patch version, a range, or something like latest
or lts/*
. For example any of the following could come from the file:
setup-node/__tests__/main.test.ts
Lines 92 to 110 in 48b9067
I think this should be using the resolved Node version, i.e. what's used as outputs.node-version
, and taking the major version from it.
Description:
The Node.js version is now included in the cache key to ensure caches are invalidated, and dependencies reinstalled, when changing Node.js versions.
Related issue:
Fixes #1171
Check list: