bump cache version

This commit is contained in:
Sergey Dolin 2023-05-04 16:35:25 +02:00
parent a3d2aaf78f
commit d836439c6a
3 changed files with 3 additions and 4 deletions

View file

@ -135,7 +135,7 @@ describe('cache-restore', () => {
await restoreCache(packageManager);
expect(hashFilesSpy).toHaveBeenCalled();
expect(infoSpy).toHaveBeenCalledWith(
`Cache restored from key: node-cache-${platform}-${packageManager}-${fileHash}`
`Cache restored from key: node-cache-${platform}-${packageManager}-v2-${fileHash}`
);
expect(infoSpy).not.toHaveBeenCalledWith(
`${packageManager} cache is not found`

2
dist/setup/index.js vendored
View file

@ -71152,7 +71152,7 @@ const restoreCache = (packageManager, cacheDependencyPath) => __awaiter(void 0,
if (!fileHash) {
throw new Error('Some specified paths were not resolved, unable to cache dependencies.');
}
const primaryKey = `node-cache-${platform}-${packageManager}-${fileHash}`;
const primaryKey = `node-cache-${platform}-${packageManager}-v2-${fileHash}`;
core.debug(`primary key is ${primaryKey}`);
core.saveState(constants_1.State.CachePrimaryKey, primaryKey);
const cacheKey = yield cache.restoreCache([cachePath], primaryKey);

View file

@ -8,7 +8,6 @@ import {State} from './constants';
import {
getCacheDirectoryPath,
getPackageManagerInfo,
getPackageManagerWorkingDir,
PackageManagerInfo
} from './cache-utils';
@ -37,7 +36,7 @@ export const restoreCache = async (
);
}
const primaryKey = `node-cache-${platform}-${packageManager}-${fileHash}`;
const primaryKey = `node-cache-${platform}-${packageManager}-v2-${fileHash}`;
core.debug(`primary key is ${primaryKey}`);
core.saveState(State.CachePrimaryKey, primaryKey);