diff --git a/dist/cache-save/index.js b/dist/cache-save/index.js index 9300df32..0506d476 100644 --- a/dist/cache-save/index.js +++ b/dist/cache-save/index.js @@ -87883,7 +87883,8 @@ 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(', ')}. This likely indicates that there are no dependencies to cache. Consider removing the cache step if it is not needed.`); + core.warning(`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.`); + return; } const primaryKey = core.getState(cache_distributor_1.State.STATE_CACHE_PRIMARY_KEY); const matchedKey = core.getState(cache_distributor_1.State.CACHE_MATCHED_KEY); diff --git a/src/cache-save.ts b/src/cache-save.ts index 4aec04e4..abeef2f3 100644 --- a/src/cache-save.ts +++ b/src/cache-save.ts @@ -38,11 +38,12 @@ async function saveCache(packageManager: string) { core.debug(`paths for caching are ${cachePaths.join(', ')}`); if (!isCacheDirectoryExists(cachePaths)) { - throw new Error( + core.warning( `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.` ); + return; } const primaryKey = core.getState(State.STATE_CACHE_PRIMARY_KEY);