mirror of
				https://github.com/actions/cache.git
				synced 2025-11-04 13:29:10 +08:00 
			
		
		
		
	Add lookup-only option (#1041)
				
					
				
			* Add new actions/cache version (with dryRun support) * Add dry-run option * Changes after rebase * Update readme * Rename option to lookup-only * Update test name * Update package.json + changelog * Update README * Update custom package version * Update custom package version * Update @actions/cache to 3.2.0 * Code review * Update log statement * Move test case --------- Co-authored-by: Sankalp Kotewar <98868223+kotewar@users.noreply.github.com>
This commit is contained in:
		
							
								
								
									
										14
									
								
								dist/save-only/index.js
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										14
									
								
								dist/save-only/index.js
									
									
									
									
										vendored
									
									
								
							@@ -5031,7 +5031,8 @@ var Inputs;
 | 
			
		||||
    Inputs["RestoreKeys"] = "restore-keys";
 | 
			
		||||
    Inputs["UploadChunkSize"] = "upload-chunk-size";
 | 
			
		||||
    Inputs["EnableCrossOsArchive"] = "enableCrossOsArchive";
 | 
			
		||||
    Inputs["FailOnCacheMiss"] = "fail-on-cache-miss"; // Input for cache, restore action
 | 
			
		||||
    Inputs["FailOnCacheMiss"] = "fail-on-cache-miss";
 | 
			
		||||
    Inputs["LookupOnly"] = "lookup-only"; // Input for cache, restore action
 | 
			
		||||
})(Inputs = exports.Inputs || (exports.Inputs = {}));
 | 
			
		||||
var Outputs;
 | 
			
		||||
(function (Outputs) {
 | 
			
		||||
@@ -41918,7 +41919,8 @@ function getDownloadOptions(copy) {
 | 
			
		||||
        useAzureSdk: true,
 | 
			
		||||
        downloadConcurrency: 8,
 | 
			
		||||
        timeoutInMs: 30000,
 | 
			
		||||
        segmentTimeoutInMs: 3600000
 | 
			
		||||
        segmentTimeoutInMs: 3600000,
 | 
			
		||||
        lookupOnly: false
 | 
			
		||||
    };
 | 
			
		||||
    if (copy) {
 | 
			
		||||
        if (typeof copy.useAzureSdk === 'boolean') {
 | 
			
		||||
@@ -41933,6 +41935,9 @@ function getDownloadOptions(copy) {
 | 
			
		||||
        if (typeof copy.segmentTimeoutInMs === 'number') {
 | 
			
		||||
            result.segmentTimeoutInMs = copy.segmentTimeoutInMs;
 | 
			
		||||
        }
 | 
			
		||||
        if (typeof copy.lookupOnly === 'boolean') {
 | 
			
		||||
            result.lookupOnly = copy.lookupOnly;
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
    const segmentDownloadTimeoutMins = process.env['SEGMENT_DOWNLOAD_TIMEOUT_MINS'];
 | 
			
		||||
    if (segmentDownloadTimeoutMins &&
 | 
			
		||||
@@ -41945,6 +41950,7 @@ function getDownloadOptions(copy) {
 | 
			
		||||
    core.debug(`Request timeout (ms): ${result.timeoutInMs}`);
 | 
			
		||||
    core.debug(`Cache segment download timeout mins env var: ${process.env['SEGMENT_DOWNLOAD_TIMEOUT_MINS']}`);
 | 
			
		||||
    core.debug(`Segment download timeout (ms): ${result.segmentTimeoutInMs}`);
 | 
			
		||||
    core.debug(`Lookup only: ${result.lookupOnly}`);
 | 
			
		||||
    return result;
 | 
			
		||||
}
 | 
			
		||||
exports.getDownloadOptions = getDownloadOptions;
 | 
			
		||||
@@ -47393,6 +47399,10 @@ function restoreCache(paths, primaryKey, restoreKeys, options, enableCrossOsArch
 | 
			
		||||
                // Cache not found
 | 
			
		||||
                return undefined;
 | 
			
		||||
            }
 | 
			
		||||
            if (options === null || options === void 0 ? void 0 : options.lookupOnly) {
 | 
			
		||||
                core.info('Lookup only - skipping download');
 | 
			
		||||
                return cacheEntry.cacheKey;
 | 
			
		||||
            }
 | 
			
		||||
            archivePath = path.join(yield utils.createTempDirectory(), utils.getCacheFileName(compressionMethod));
 | 
			
		||||
            core.debug(`Archive Path: ${archivePath}`);
 | 
			
		||||
            // Download the cache from the cache entry
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user