From 86c3d7397e821972003edcc29fd033d91fad5c3f Mon Sep 17 00:00:00 2001 From: lmvysakh Date: Thu, 13 Aug 2026 12:45:15 +0530 Subject: [PATCH 1/2] Error message updated --- __tests__/cache-restore.test.ts | 4 +++- dist/cache-save/index.js | 2 +- dist/setup/index.js | 2 +- src/cache-distributions/cache-distributor.ts | 2 +- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/__tests__/cache-restore.test.ts b/__tests__/cache-restore.test.ts index 914bd5e57..4b549f518 100644 --- a/__tests__/cache-restore.test.ts +++ b/__tests__/cache-restore.test.ts @@ -276,7 +276,9 @@ virtualenvs.path = "{cache-dir}/virtualenvs" # /Users/patrick/Library/Caches/py await expect(cacheDistributor.restoreCache()).rejects.toThrow( `No file in ${process.cwd()} matched to [${cacheDependencyPath .split('\n') - .join(',')}], make sure you have checked out the target repository` + .join( + ',' + )}] for ${packageManager}. Make sure you have checked out the target repository, or consider removing the cache step if there are no dependencies to cache.` ); } ); diff --git a/dist/cache-save/index.js b/dist/cache-save/index.js index 056f9e6ad..8d5ba81a6 100644 --- a/dist/cache-save/index.js +++ b/dist/cache-save/index.js @@ -97948,7 +97948,7 @@ class CacheDistributor { .split('\n') .join(',')} or ${CACHE_DEPENDENCY_BACKUP_PATH}` : this.cacheDependencyPath.split('\n').join(','); - throw new Error(`No file in ${process.cwd()} matched to [${file}], make sure you have checked out the target repository`); + throw new Error(`  No file in ${process.cwd()} matched to [${file}] for ${this.packageManager}. Make sure you have checked out the target repository, or consider removing the cache step if there are no dependencies to cache.`); } const cachePath = await this.getCacheGlobalDirectories(); core.saveState(State.CACHE_PATHS, cachePath); diff --git a/dist/setup/index.js b/dist/setup/index.js index 16fe5c6f2..e2c8ba42e 100644 --- a/dist/setup/index.js +++ b/dist/setup/index.js @@ -103175,7 +103175,7 @@ class CacheDistributor { .split('\n') .join(',')} or ${CACHE_DEPENDENCY_BACKUP_PATH}` : this.cacheDependencyPath.split('\n').join(','); - throw new Error(`No file in ${process.cwd()} matched to [${file}], make sure you have checked out the target repository`); + throw new Error(`  No file in ${process.cwd()} matched to [${file}] for ${this.packageManager}. Make sure you have checked out the target repository, or consider removing the cache step if there are no dependencies to cache.`); } const cachePath = await this.getCacheGlobalDirectories(); saveState(State.CACHE_PATHS, cachePath); diff --git a/src/cache-distributions/cache-distributor.ts b/src/cache-distributions/cache-distributor.ts index 8c4a69321..a151900c7 100644 --- a/src/cache-distributions/cache-distributor.ts +++ b/src/cache-distributions/cache-distributor.ts @@ -60,7 +60,7 @@ abstract class CacheDistributor { .join(',')} or ${CACHE_DEPENDENCY_BACKUP_PATH}` : this.cacheDependencyPath.split('\n').join(','); throw new Error( - `No file in ${process.cwd()} matched to [${file}], make sure you have checked out the target repository` + `  No file in ${process.cwd()} matched to [${file}] for ${this.packageManager}. Make sure you have checked out the target repository, or consider removing the cache step if there are no dependencies to cache.` ); } From 0db3ddac2f5f299392a57f85bea640cfba9c04d5 Mon Sep 17 00:00:00 2001 From: lmvysakh Date: Thu, 13 Aug 2026 16:34:44 +0530 Subject: [PATCH 2/2] Fixed whitespace lint error --- dist/cache-save/index.js | 2 +- dist/setup/index.js | 2 +- src/cache-distributions/cache-distributor.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/dist/cache-save/index.js b/dist/cache-save/index.js index 8d5ba81a6..bee6394e6 100644 --- a/dist/cache-save/index.js +++ b/dist/cache-save/index.js @@ -97948,7 +97948,7 @@ class CacheDistributor { .split('\n') .join(',')} or ${CACHE_DEPENDENCY_BACKUP_PATH}` : this.cacheDependencyPath.split('\n').join(','); - throw new Error(`  No file in ${process.cwd()} matched to [${file}] for ${this.packageManager}. Make sure you have checked out the target repository, or consider removing the cache step if there are no dependencies to cache.`); + throw new Error(` No file in ${process.cwd()} matched to [${file}] for ${this.packageManager}. Make sure you have checked out the target repository, or consider removing the cache step if there are no dependencies to cache.`); } const cachePath = await this.getCacheGlobalDirectories(); core.saveState(State.CACHE_PATHS, cachePath); diff --git a/dist/setup/index.js b/dist/setup/index.js index e2c8ba42e..deffa09d1 100644 --- a/dist/setup/index.js +++ b/dist/setup/index.js @@ -103175,7 +103175,7 @@ class CacheDistributor { .split('\n') .join(',')} or ${CACHE_DEPENDENCY_BACKUP_PATH}` : this.cacheDependencyPath.split('\n').join(','); - throw new Error(`  No file in ${process.cwd()} matched to [${file}] for ${this.packageManager}. Make sure you have checked out the target repository, or consider removing the cache step if there are no dependencies to cache.`); + throw new Error(` No file in ${process.cwd()} matched to [${file}] for ${this.packageManager}. Make sure you have checked out the target repository, or consider removing the cache step if there are no dependencies to cache.`); } const cachePath = await this.getCacheGlobalDirectories(); saveState(State.CACHE_PATHS, cachePath); diff --git a/src/cache-distributions/cache-distributor.ts b/src/cache-distributions/cache-distributor.ts index a151900c7..73b79355e 100644 --- a/src/cache-distributions/cache-distributor.ts +++ b/src/cache-distributions/cache-distributor.ts @@ -60,7 +60,7 @@ abstract class CacheDistributor { .join(',')} or ${CACHE_DEPENDENCY_BACKUP_PATH}` : this.cacheDependencyPath.split('\n').join(','); throw new Error( - `  No file in ${process.cwd()} matched to [${file}] for ${this.packageManager}. Make sure you have checked out the target repository, or consider removing the cache step if there are no dependencies to cache.` + ` No file in ${process.cwd()} matched to [${file}] for ${this.packageManager}. Make sure you have checked out the target repository, or consider removing the cache step if there are no dependencies to cache.` ); }