mirror of
				https://github.com/actions/cache.git
				synced 2025-11-04 03:04:01 +00: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:
 | 
					  upload-chunk-size:
 | 
				
			||||||
    description: 'The chunk size used to split up large files during upload, in bytes'
 | 
					    description: 'The chunk size used to split up large files during upload, in bytes'
 | 
				
			||||||
    required: false
 | 
					    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:
 | 
					outputs:
 | 
				
			||||||
  cache-hit:
 | 
					  cache-hit:
 | 
				
			||||||
    description: 'A boolean value to indicate an exact match was found for the primary key'
 | 
					    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["Path"] = "path";
 | 
				
			||||||
    Inputs["RestoreKeys"] = "restore-keys";
 | 
					    Inputs["RestoreKeys"] = "restore-keys";
 | 
				
			||||||
    Inputs["UploadChunkSize"] = "upload-chunk-size";
 | 
					    Inputs["UploadChunkSize"] = "upload-chunk-size";
 | 
				
			||||||
 | 
					    Inputs["SkipUpload"] = "skip-upload";
 | 
				
			||||||
})(Inputs = exports.Inputs || (exports.Inputs = {}));
 | 
					})(Inputs = exports.Inputs || (exports.Inputs = {}));
 | 
				
			||||||
var Outputs;
 | 
					var Outputs;
 | 
				
			||||||
(function (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["Path"] = "path";
 | 
				
			||||||
    Inputs["RestoreKeys"] = "restore-keys";
 | 
					    Inputs["RestoreKeys"] = "restore-keys";
 | 
				
			||||||
    Inputs["UploadChunkSize"] = "upload-chunk-size";
 | 
					    Inputs["UploadChunkSize"] = "upload-chunk-size";
 | 
				
			||||||
 | 
					    Inputs["SkipUpload"] = "skip-upload";
 | 
				
			||||||
})(Inputs = exports.Inputs || (exports.Inputs = {}));
 | 
					})(Inputs = exports.Inputs || (exports.Inputs = {}));
 | 
				
			||||||
var Outputs;
 | 
					var Outputs;
 | 
				
			||||||
(function (Outputs) {
 | 
					(function (Outputs) {
 | 
				
			||||||
@ -46795,6 +46796,9 @@ function run() {
 | 
				
			|||||||
                core.info(`Cache hit occurred on the primary key ${primaryKey}, not saving cache.`);
 | 
					                core.info(`Cache hit occurred on the primary key ${primaryKey}, not saving cache.`);
 | 
				
			||||||
                return;
 | 
					                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, {
 | 
					            const cachePaths = utils.getInputAsArray(constants_1.Inputs.Path, {
 | 
				
			||||||
                required: true
 | 
					                required: true
 | 
				
			||||||
            });
 | 
					            });
 | 
				
			||||||
 | 
				
			|||||||
@ -2,7 +2,8 @@ export enum Inputs {
 | 
				
			|||||||
    Key = "key",
 | 
					    Key = "key",
 | 
				
			||||||
    Path = "path",
 | 
					    Path = "path",
 | 
				
			||||||
    RestoreKeys = "restore-keys",
 | 
					    RestoreKeys = "restore-keys",
 | 
				
			||||||
    UploadChunkSize = "upload-chunk-size"
 | 
					    UploadChunkSize = "upload-chunk-size",
 | 
				
			||||||
 | 
					    SkipUpload = "skip-upload"
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
export enum Outputs {
 | 
					export enum Outputs {
 | 
				
			||||||
 | 
				
			|||||||
@ -40,6 +40,12 @@ async function run(): Promise<void> {
 | 
				
			|||||||
            return;
 | 
					            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, {
 | 
					        const cachePaths = utils.getInputAsArray(Inputs.Path, {
 | 
				
			||||||
            required: true
 | 
					            required: true
 | 
				
			||||||
        });
 | 
					        });
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user