mirror of
				https://github.com/actions/cache.git
				synced 2025-11-04 13:29:10 +08:00 
			
		
		
		
	Restore original behavior of cache-hit output (#1467)
				
					
				
			* Restore original behavior of `cache-hit` output * Bump version to 4.1.1
This commit is contained in:
		
							
								
								
									
										3
									
								
								dist/restore/index.js
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										3
									
								
								dist/restore/index.js
									
									
									
									
										vendored
									
									
								
							@@ -59415,7 +59415,8 @@ function restoreImpl(stateProvider, earlyExit) {
 | 
			
		||||
            const lookupOnly = utils.getInputAsBool(constants_1.Inputs.LookupOnly);
 | 
			
		||||
            const cacheKey = yield cache.restoreCache(cachePaths, primaryKey, restoreKeys, { lookupOnly: lookupOnly }, enableCrossOsArchive);
 | 
			
		||||
            if (!cacheKey) {
 | 
			
		||||
                core.setOutput(constants_1.Outputs.CacheHit, false.toString());
 | 
			
		||||
                // `cache-hit` is intentionally not set to `false` here to preserve existing behavior
 | 
			
		||||
                // See https://github.com/actions/cache/issues/1466
 | 
			
		||||
                if (failOnCacheMiss) {
 | 
			
		||||
                    throw new Error(`Failed to restore cache entry. Exiting as fail-on-cache-miss is set. Input key: ${primaryKey}`);
 | 
			
		||||
                }
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user