Skip to content

Commit

Permalink
Add primaryKey check
Browse files Browse the repository at this point in the history
  • Loading branch information
dsame committed Mar 6, 2023
1 parent 90c1ee1 commit 9f133c2
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
4 changes: 4 additions & 0 deletions dist/cache-save/index.js
Expand Up @@ -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;
Expand Down
7 changes: 7 additions & 0 deletions src/cache-save.ts
Expand Up @@ -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.`
Expand Down

0 comments on commit 9f133c2

Please sign in to comment.