From d836439c6a04836ef0186240e4ec5def7d250fdd Mon Sep 17 00:00:00 2001 From: Sergey Dolin Date: Thu, 4 May 2023 16:35:25 +0200 Subject: [PATCH] bump cache version --- __tests__/cache-restore.test.ts | 2 +- dist/setup/index.js | 2 +- src/cache-restore.ts | 3 +-- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/__tests__/cache-restore.test.ts b/__tests__/cache-restore.test.ts index df9170ad..59135452 100644 --- a/__tests__/cache-restore.test.ts +++ b/__tests__/cache-restore.test.ts @@ -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` diff --git a/dist/setup/index.js b/dist/setup/index.js index c6d970ea..eae17a84 100644 --- a/dist/setup/index.js +++ b/dist/setup/index.js @@ -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); diff --git a/src/cache-restore.ts b/src/cache-restore.ts index c7317270..0341c109 100644 --- a/src/cache-restore.ts +++ b/src/cache-restore.ts @@ -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);