From 9f133c24fcc22ea45b7902ee37f79f1ea8620275 Mon Sep 17 00:00:00 2001 From: Sergey Dolin Date: Mon, 6 Mar 2023 16:51:42 +0100 Subject: [PATCH] Add primaryKey check --- dist/cache-save/index.js | 4 ++++ src/cache-save.ts | 7 +++++++ 2 files changed, 11 insertions(+) diff --git a/dist/cache-save/index.js b/dist/cache-save/index.js index 952b49c94..717e2f873 100644 --- a/dist/cache-save/index.js +++ b/dist/cache-save/index.js @@ -60379,6 +60379,10 @@ const cachePackages = () => __awaiter(void 0, void 0, void 0, function* () { if (nonExistingPaths.length) { logWarning(`Cache folder path is retrieved but doesn't exist on disk: ${nonExistingPaths.join(', ')}`); } + if (!primaryKey) { + core.info('Primary key was not generated. Please check the log messages above for more errors or information'); + return; + } if (primaryKey === state) { core.info(`Cache hit occurred on the primary key ${primaryKey}, not saving cache.`); return; diff --git a/src/cache-save.ts b/src/cache-save.ts index 0eada595d..584d0a697 100644 --- a/src/cache-save.ts +++ b/src/cache-save.ts @@ -59,6 +59,13 @@ const cachePackages = async () => { ); } + if (!primaryKey) { + core.info( + 'Primary key was not generated. Please check the log messages above for more errors or information' + ); + return; + } + if (primaryKey === state) { core.info( `Cache hit occurred on the primary key ${primaryKey}, not saving cache.`