You've already forked setup-python
							
							
				mirror of
				https://github.com/actions/setup-python.git
				synced 2025-11-04 08:46:41 +07:00 
			
		
		
		
	Update error message for no dependencies to cache (#968)
This commit is contained in:
		
							
								
								
									
										2
									
								
								dist/cache-save/index.js
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								dist/cache-save/index.js
									
									
									
									
										vendored
									
									
								
							@ -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(`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 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);
 | 
				
			||||||
 | 
				
			|||||||
@ -41,7 +41,7 @@ async function saveCache(packageManager: string) {
 | 
				
			|||||||
    throw new Error(
 | 
					    throw new Error(
 | 
				
			||||||
      `Cache folder path is retrieved for ${packageManager} but doesn't exist on disk: ${cachePaths.join(
 | 
					      `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.`
 | 
				
			||||||
    );
 | 
					    );
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user