mirror of
				https://github.com/actions/cache.git
				synced 2025-11-04 07:38:37 +08:00 
			
		
		
		
	Add option to skip uploading of cache
This commit is contained in:
		
							parent
							
								
									f4278025ab
								
							
						
					
					
						commit
						015084af58
					
				| 
						 | 
				
			
			@ -14,6 +14,10 @@ inputs:
 | 
			
		|||
  upload-chunk-size:
 | 
			
		||||
    description: 'The chunk size used to split up large files during upload, in bytes'
 | 
			
		||||
    required: false
 | 
			
		||||
  skip-upload:
 | 
			
		||||
    description: 'Set this to true to skip uploading the cache at the end even if we got a miss'
 | 
			
		||||
    required: false
 | 
			
		||||
    default: 'false'
 | 
			
		||||
outputs:
 | 
			
		||||
  cache-hit:
 | 
			
		||||
    description: 'A boolean value to indicate an exact match was found for the primary key'
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										1
									
								
								dist/restore/index.js
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										1
									
								
								dist/restore/index.js
									
									
									
									
										vendored
									
									
								
							| 
						 | 
				
			
			@ -4616,6 +4616,7 @@ var Inputs;
 | 
			
		|||
    Inputs["Path"] = "path";
 | 
			
		||||
    Inputs["RestoreKeys"] = "restore-keys";
 | 
			
		||||
    Inputs["UploadChunkSize"] = "upload-chunk-size";
 | 
			
		||||
    Inputs["SkipUpload"] = "skip-upload";
 | 
			
		||||
})(Inputs = exports.Inputs || (exports.Inputs = {}));
 | 
			
		||||
var Outputs;
 | 
			
		||||
(function (Outputs) {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										4
									
								
								dist/save/index.js
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										4
									
								
								dist/save/index.js
									
									
									
									
										vendored
									
									
								
							| 
						 | 
				
			
			@ -4616,6 +4616,7 @@ var Inputs;
 | 
			
		|||
    Inputs["Path"] = "path";
 | 
			
		||||
    Inputs["RestoreKeys"] = "restore-keys";
 | 
			
		||||
    Inputs["UploadChunkSize"] = "upload-chunk-size";
 | 
			
		||||
    Inputs["SkipUpload"] = "skip-upload";
 | 
			
		||||
})(Inputs = exports.Inputs || (exports.Inputs = {}));
 | 
			
		||||
var Outputs;
 | 
			
		||||
(function (Outputs) {
 | 
			
		||||
| 
						 | 
				
			
			@ -46795,6 +46796,9 @@ function run() {
 | 
			
		|||
                core.info(`Cache hit occurred on the primary key ${primaryKey}, not saving cache.`);
 | 
			
		||||
                return;
 | 
			
		||||
            }
 | 
			
		||||
            if (core.getBooleanInput(constants_1.Inputs.SkipUpload)) {
 | 
			
		||||
                core.info(`Skipping upload of cache since the skip-upload input was set.`);
 | 
			
		||||
            }
 | 
			
		||||
            const cachePaths = utils.getInputAsArray(constants_1.Inputs.Path, {
 | 
			
		||||
                required: true
 | 
			
		||||
            });
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -2,7 +2,8 @@ export enum Inputs {
 | 
			
		|||
    Key = "key",
 | 
			
		||||
    Path = "path",
 | 
			
		||||
    RestoreKeys = "restore-keys",
 | 
			
		||||
    UploadChunkSize = "upload-chunk-size"
 | 
			
		||||
    UploadChunkSize = "upload-chunk-size",
 | 
			
		||||
    SkipUpload = "skip-upload"
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
export enum Outputs {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -40,6 +40,12 @@ async function run(): Promise<void> {
 | 
			
		|||
            return;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        if (core.getBooleanInput(Inputs.SkipUpload)) {
 | 
			
		||||
            core.info(
 | 
			
		||||
                `Skipping upload of cache since the skip-upload input was set.`
 | 
			
		||||
            );
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        const cachePaths = utils.getInputAsArray(Inputs.Path, {
 | 
			
		||||
            required: true
 | 
			
		||||
        });
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue
	
	Block a user