Skip to content

Commit

Permalink
Update error message for no dependencies to cache (actions#968)
Browse files Browse the repository at this point in the history
  • Loading branch information
aparnajyothi-y authored Nov 5, 2024
1 parent 0b93645 commit 55aad42
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion dist/cache-save/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -81165,7 +81165,7 @@ function saveCache(packageManager) {
const cachePaths = JSON.parse(cachePathState);
core.debug(`paths for caching are ${cachePaths.join(', ')}`);
if (!isCacheDirectoryExists(cachePaths)) {
throw new Error(`Cache folder path is retrieved for ${packageManager} but doesn't exist on disk: ${cachePaths.join(', ')}`);
throw new Error(`Cache folder path is retrieved for ${packageManager} but doesn't exist on disk: ${cachePaths.join(', ')}. This likely indicates that there are no dependencies to cache. Consider removing the cache step if it is not needed.`);
}
const primaryKey = core.getState(cache_distributor_1.State.STATE_CACHE_PRIMARY_KEY);
const matchedKey = core.getState(cache_distributor_1.State.CACHE_MATCHED_KEY);
Expand Down
2 changes: 1 addition & 1 deletion src/cache-save.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ async function saveCache(packageManager: string) {
throw new Error(
`Cache folder path is retrieved for ${packageManager} but doesn't exist on disk: ${cachePaths.join(
', '
)}`
)}. This likely indicates that there are no dependencies to cache. Consider removing the cache step if it is not needed.`
);
}

Expand Down

0 comments on commit 55aad42

Please sign in to comment.