mirror of
				https://github.com/actions/cache.git
				synced 2025-11-04 10:14:02 +00:00 
			
		
		
		
	Add reeval & only-restore boolean input parameters
				
					
				
			* implement only-restore within save
This commit is contained in:
		
							parent
							
								
									c3f1317a9e
								
							
						
					
					
						commit
						4827442d41
					
				
							
								
								
									
										3
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										3
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							@ -94,3 +94,6 @@ typings/
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
# Text editor files
 | 
					# Text editor files
 | 
				
			||||||
.vscode/
 | 
					.vscode/
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# OS
 | 
				
			||||||
 | 
					.DS_Store
 | 
				
			||||||
 | 
				
			|||||||
@ -14,6 +14,14 @@ 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
 | 
				
			||||||
 | 
					  reeval:
 | 
				
			||||||
 | 
					    description: 'Boolean. Whether to reevaluate the key argument in post. Set to TRUE if you would like your cache key set after your job's steps are complete.'
 | 
				
			||||||
 | 
					    required: false
 | 
				
			||||||
 | 
					    default: false
 | 
				
			||||||
 | 
					  only-restore:
 | 
				
			||||||
 | 
					    description: 'Boolean. Whether to only perform cache restoration and NOT the save post run step.'
 | 
				
			||||||
 | 
					    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,6 +1,8 @@
 | 
				
			|||||||
export enum Inputs {
 | 
					export enum Inputs {
 | 
				
			||||||
    Key = "key",
 | 
					    Key = "key",
 | 
				
			||||||
 | 
					    OnlyRestore = "only-restore",
 | 
				
			||||||
    Path = "path",
 | 
					    Path = "path",
 | 
				
			||||||
 | 
					    Reeval = "reeval",
 | 
				
			||||||
    RestoreKeys = "restore-keys",
 | 
					    RestoreKeys = "restore-keys",
 | 
				
			||||||
    UploadChunkSize = "upload-chunk-size"
 | 
					    UploadChunkSize = "upload-chunk-size"
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
				
			|||||||
@ -10,6 +10,8 @@ import * as utils from "./utils/actionUtils";
 | 
				
			|||||||
process.on("uncaughtException", e => utils.logWarning(e.message));
 | 
					process.on("uncaughtException", e => utils.logWarning(e.message));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
async function run(): Promise<void> {
 | 
					async function run(): Promise<void> {
 | 
				
			||||||
 | 
					    const save = ! core.getBooleanInput(Inputs.OnlyRestore);
 | 
				
			||||||
 | 
					    if (save) {
 | 
				
			||||||
        try {
 | 
					        try {
 | 
				
			||||||
            if (!utils.isCacheFeatureAvailable()) {
 | 
					            if (!utils.isCacheFeatureAvailable()) {
 | 
				
			||||||
                return;
 | 
					                return;
 | 
				
			||||||
@ -63,6 +65,7 @@ async function run(): Promise<void> {
 | 
				
			|||||||
            utils.logWarning((error as Error).message);
 | 
					            utils.logWarning((error as Error).message);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
run();
 | 
					run();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user