mirror of
				https://github.com/actions/cache.git
				synced 2025-11-04 03:34:00 +00:00 
			
		
		
		
	Trying with inputs
This commit is contained in:
		
							parent
							
								
									f17d1159c8
								
							
						
					
					
						commit
						1cbab03e0e
					
				@ -18,7 +18,7 @@ inputs:
 | 
				
			|||||||
    description: 'Fail the workflow if the cache is not found for the given key.'
 | 
					    description: 'Fail the workflow if the cache is not found for the given key.'
 | 
				
			||||||
    required: false
 | 
					    required: false
 | 
				
			||||||
    default: "false"
 | 
					    default: "false"
 | 
				
			||||||
  save-cache-on-any-failure:
 | 
					  saveCacheOnAnyFailure:
 | 
				
			||||||
    description: 'Save build cache despite of failure in the job'
 | 
					    description: 'Save build cache despite of failure in the job'
 | 
				
			||||||
    default: 'no'
 | 
					    default: 'no'
 | 
				
			||||||
outputs:
 | 
					outputs:
 | 
				
			||||||
@ -28,7 +28,7 @@ runs:
 | 
				
			|||||||
  using: 'node16'
 | 
					  using: 'node16'
 | 
				
			||||||
  main: 'dist/restore/index.js'
 | 
					  main: 'dist/restore/index.js'
 | 
				
			||||||
  post: 'dist/save/index.js'
 | 
					  post: 'dist/save/index.js'
 | 
				
			||||||
  post-if: success() || env.INPUT_SAVE-CACHE-ON-ANY-FAILURE == 'yes'
 | 
					  post-if: (success() || (env.INPUT_SAVECACHEONANYFAILURE == 'yes'))
 | 
				
			||||||
branding:
 | 
					branding:
 | 
				
			||||||
  icon: 'archive'
 | 
					  icon: 'archive'
 | 
				
			||||||
  color: 'gray-dark'
 | 
					  color: 'gray-dark'
 | 
				
			||||||
 | 
				
			|||||||
							
								
								
									
										4
									
								
								dist/restore/index.js
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										4
									
								
								dist/restore/index.js
									
									
									
									
										vendored
									
									
								
							@ -4948,7 +4948,7 @@ var Inputs;
 | 
				
			|||||||
    Inputs["RestoreKeys"] = "restore-keys";
 | 
					    Inputs["RestoreKeys"] = "restore-keys";
 | 
				
			||||||
    Inputs["UploadChunkSize"] = "upload-chunk-size";
 | 
					    Inputs["UploadChunkSize"] = "upload-chunk-size";
 | 
				
			||||||
    Inputs["StrictRestore"] = "strict-restore";
 | 
					    Inputs["StrictRestore"] = "strict-restore";
 | 
				
			||||||
    Inputs["SaveCacheOnAnyFailure"] = "save-cache-on-any-failure";
 | 
					    Inputs["SaveCacheOnAnyFailure"] = "saveCacheOnAnyFailure";
 | 
				
			||||||
})(Inputs = exports.Inputs || (exports.Inputs = {}));
 | 
					})(Inputs = exports.Inputs || (exports.Inputs = {}));
 | 
				
			||||||
var Outputs;
 | 
					var Outputs;
 | 
				
			||||||
(function (Outputs) {
 | 
					(function (Outputs) {
 | 
				
			||||||
@ -48991,7 +48991,7 @@ function run() {
 | 
				
			|||||||
            const saveCache = core.getInput(constants_1.Inputs.SaveCacheOnAnyFailure);
 | 
					            const saveCache = core.getInput(constants_1.Inputs.SaveCacheOnAnyFailure);
 | 
				
			||||||
            if (saveCache === "yes") {
 | 
					            if (saveCache === "yes") {
 | 
				
			||||||
                core.saveState(constants_1.State.SaveCache, saveCache);
 | 
					                core.saveState(constants_1.State.SaveCache, saveCache);
 | 
				
			||||||
                core.info(`Input save-cache-on-any-failure is set to yes, the cache will be saved despite of any failure in the build.`);
 | 
					                core.info(`Input saveCacheOnAnyFailure is set to yes, the cache will be saved despite of any failure in the build.`);
 | 
				
			||||||
                core.info(core.getState(constants_1.State.SaveCache));
 | 
					                core.info(core.getState(constants_1.State.SaveCache));
 | 
				
			||||||
                core.info(core.getState(constants_1.State.CachePrimaryKey));
 | 
					                core.info(core.getState(constants_1.State.CachePrimaryKey));
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
 | 
				
			|||||||
							
								
								
									
										2
									
								
								dist/save/index.js
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								dist/save/index.js
									
									
									
									
										vendored
									
									
								
							@ -4948,7 +4948,7 @@ var Inputs;
 | 
				
			|||||||
    Inputs["RestoreKeys"] = "restore-keys";
 | 
					    Inputs["RestoreKeys"] = "restore-keys";
 | 
				
			||||||
    Inputs["UploadChunkSize"] = "upload-chunk-size";
 | 
					    Inputs["UploadChunkSize"] = "upload-chunk-size";
 | 
				
			||||||
    Inputs["StrictRestore"] = "strict-restore";
 | 
					    Inputs["StrictRestore"] = "strict-restore";
 | 
				
			||||||
    Inputs["SaveCacheOnAnyFailure"] = "save-cache-on-any-failure";
 | 
					    Inputs["SaveCacheOnAnyFailure"] = "saveCacheOnAnyFailure";
 | 
				
			||||||
})(Inputs = exports.Inputs || (exports.Inputs = {}));
 | 
					})(Inputs = exports.Inputs || (exports.Inputs = {}));
 | 
				
			||||||
var Outputs;
 | 
					var Outputs;
 | 
				
			||||||
(function (Outputs) {
 | 
					(function (Outputs) {
 | 
				
			||||||
 | 
				
			|||||||
@ -4,7 +4,7 @@ export enum Inputs {
 | 
				
			|||||||
    RestoreKeys = "restore-keys",
 | 
					    RestoreKeys = "restore-keys",
 | 
				
			||||||
    UploadChunkSize = "upload-chunk-size",
 | 
					    UploadChunkSize = "upload-chunk-size",
 | 
				
			||||||
    StrictRestore = "strict-restore",
 | 
					    StrictRestore = "strict-restore",
 | 
				
			||||||
    SaveCacheOnAnyFailure = "save-cache-on-any-failure"
 | 
					    SaveCacheOnAnyFailure = "saveCacheOnAnyFailure"
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
export enum Outputs {
 | 
					export enum Outputs {
 | 
				
			||||||
 | 
				
			|||||||
@ -40,7 +40,7 @@ async function run(): Promise<void> {
 | 
				
			|||||||
        if (saveCache === "yes") {
 | 
					        if (saveCache === "yes") {
 | 
				
			||||||
            core.saveState(State.SaveCache, saveCache);
 | 
					            core.saveState(State.SaveCache, saveCache);
 | 
				
			||||||
            core.info(
 | 
					            core.info(
 | 
				
			||||||
                `Input save-cache-on-any-failure is set to yes, the cache will be saved despite of any failure in the build.`
 | 
					                `Input saveCacheOnAnyFailure is set to yes, the cache will be saved despite of any failure in the build.`
 | 
				
			||||||
            );
 | 
					            );
 | 
				
			||||||
            core.info(core.getState(State.SaveCache));
 | 
					            core.info(core.getState(State.SaveCache));
 | 
				
			||||||
            core.info(core.getState(State.CachePrimaryKey));
 | 
					            core.info(core.getState(State.CachePrimaryKey));
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user