mirror of
https://github.com/actions/setup-node.git
synced 2025-07-26 08:28:23 +02:00
fix: cache key should include node version
This commit is contained in:
parent
969bd26639
commit
2792b3f52b
3 changed files with 12 additions and 8 deletions
|
@ -12,6 +12,7 @@ import {
|
|||
} from './cache-utils';
|
||||
|
||||
export const restoreCache = async (
|
||||
nodeVersion: string,
|
||||
packageManager: string,
|
||||
cacheDependencyPath?: string
|
||||
) => {
|
||||
|
@ -36,7 +37,8 @@ export const restoreCache = async (
|
|||
);
|
||||
}
|
||||
|
||||
const primaryKey = `node-cache-${platform}-${packageManager}-${fileHash}`;
|
||||
const nodeMajor = nodeVersion.split('.')[0];
|
||||
const primaryKey = `node-cache-${nodeMajor}-${platform}-${packageManager}-${fileHash}`;
|
||||
core.debug(`primary key is ${primaryKey}`);
|
||||
|
||||
core.saveState(State.CachePrimaryKey, primaryKey);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue