updated error message

This commit is contained in:
Aparna Jyothi 2024-09-20 15:09:44 +05:30
parent 240e4e247f
commit b9a674e48d
4 changed files with 10 additions and 6 deletions

View File

@ -81041,7 +81041,7 @@ class CacheDistributor {
.split('\n') .split('\n')
.join(',')} or ${constants_1.CACHE_DEPENDENCY_BACKUP_PATH}` .join(',')} or ${constants_1.CACHE_DEPENDENCY_BACKUP_PATH}`
: this.cacheDependencyPath.split('\n').join(','); : 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}], make sure you have checked out the target repository. No cache paths were identified for ${this.packageManager} with cache-dependency-path = ${this.cacheDependencyPath}. This likely indicates no dependencies to cache. Consider removing the cache step if it's not needed`);
} }
const cachePath = yield this.getCacheGlobalDirectories(); const cachePath = yield this.getCacheGlobalDirectories();
core.saveState(State.CACHE_PATHS, cachePath); core.saveState(State.CACHE_PATHS, cachePath);
@ -81165,7 +81165,7 @@ function saveCache(packageManager) {
const cachePaths = JSON.parse(cachePathState); const cachePaths = JSON.parse(cachePathState);
core.debug(`paths for caching are ${cachePaths.join(', ')}`); core.debug(`paths for caching are ${cachePaths.join(', ')}`);
if (!isCacheDirectoryExists(cachePaths)) { if (!isCacheDirectoryExists(cachePaths)) {
throw new Error(`Cache folder path is retrieved for ${packageManager} but doesn't exist on disk: ${cachePaths.join(', ')}`); throw new Error(`No file in ${process.cwd()} matched to [${cachePaths.join(', ')}], make sure you have checked out the target repository. No cache paths were identified for ${packageManager} with cache-dependency-path. This likely indicates no dependencies to cache. Consider removing the cache step if it's not needed.`);
} }
const primaryKey = core.getState(cache_distributor_1.State.STATE_CACHE_PRIMARY_KEY); const primaryKey = core.getState(cache_distributor_1.State.STATE_CACHE_PRIMARY_KEY);
const matchedKey = core.getState(cache_distributor_1.State.CACHE_MATCHED_KEY); const matchedKey = core.getState(cache_distributor_1.State.CACHE_MATCHED_KEY);

2
dist/setup/index.js vendored
View File

@ -90243,7 +90243,7 @@ class CacheDistributor {
.split('\n') .split('\n')
.join(',')} or ${constants_1.CACHE_DEPENDENCY_BACKUP_PATH}` .join(',')} or ${constants_1.CACHE_DEPENDENCY_BACKUP_PATH}`
: this.cacheDependencyPath.split('\n').join(','); : 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}], make sure you have checked out the target repository. No cache paths were identified for ${this.packageManager} with cache-dependency-path = ${this.cacheDependencyPath}. This likely indicates no dependencies to cache. Consider removing the cache step if it's not needed`);
} }
const cachePath = yield this.getCacheGlobalDirectories(); const cachePath = yield this.getCacheGlobalDirectories();
core.saveState(State.CACHE_PATHS, cachePath); core.saveState(State.CACHE_PATHS, cachePath);

View File

@ -32,7 +32,11 @@ abstract class CacheDistributor {
.join(',')} or ${CACHE_DEPENDENCY_BACKUP_PATH}` .join(',')} or ${CACHE_DEPENDENCY_BACKUP_PATH}`
: this.cacheDependencyPath.split('\n').join(','); : this.cacheDependencyPath.split('\n').join(',');
throw new Error( 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}], make sure you have checked out the target repository. No cache paths were identified for ${
this.packageManager
} with cache-dependency-path = ${
this.cacheDependencyPath
}. This likely indicates no dependencies to cache. Consider removing the cache step if it's not needed`
); );
} }

View File

@ -39,9 +39,9 @@ async function saveCache(packageManager: string) {
if (!isCacheDirectoryExists(cachePaths)) { if (!isCacheDirectoryExists(cachePaths)) {
throw new Error( throw new Error(
`Cache folder path is retrieved for ${packageManager} but doesn't exist on disk: ${cachePaths.join( `No file in ${process.cwd()} matched to [${cachePaths.join(
', ' ', '
)}` )}], make sure you have checked out the target repository. No cache paths were identified for ${packageManager} with cache-dependency-path. This likely indicates no dependencies to cache. Consider removing the cache step if it's not needed.`
); );
} }