fix: cache key should include node version

This commit is contained in:
Steven 2022-09-30 15:11:50 -04:00
parent 969bd26639
commit 2792b3f52b
3 changed files with 12 additions and 8 deletions

View file

@ -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);