Merge pull request #1283 from crazy-max/named-context-handlebars
handlebar defaultContext support for build-contexts input
This commit is contained in:
		
						commit
						128779fed7
					
				
							
								
								
									
										2
									
								
								dist/index.js
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								dist/index.js
									
									
									
										generated
									
									
										vendored
									
									
								
							
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							
							
								
								
									
										2
									
								
								dist/index.js.map
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								dist/index.js.map
									
									
									
										generated
									
									
										vendored
									
									
								
							
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							| @ -132,7 +132,12 @@ async function getBuildArgs(inputs: Inputs, context: string, toolkit: Toolkit): | |||||||
|   }); |   }); | ||||||
|   if (await toolkit.buildx.versionSatisfies('>=0.8.0')) { |   if (await toolkit.buildx.versionSatisfies('>=0.8.0')) { | ||||||
|     await Util.asyncForEach(inputs['build-contexts'], async buildContext => { |     await Util.asyncForEach(inputs['build-contexts'], async buildContext => { | ||||||
|       args.push('--build-context', buildContext); |       args.push( | ||||||
|  |         '--build-context', | ||||||
|  |         handlebars.compile(buildContext)({ | ||||||
|  |           defaultContext: Context.gitContext() | ||||||
|  |         }) | ||||||
|  |       ); | ||||||
|     }); |     }); | ||||||
|   } else if (inputs['build-contexts'].length > 0) { |   } else if (inputs['build-contexts'].length > 0) { | ||||||
|     core.warning("Build contexts are only supported by buildx >= 0.8.0; the input 'build-contexts' is ignored."); |     core.warning("Build contexts are only supported by buildx >= 0.8.0; the input 'build-contexts' is ignored."); | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 CrazyMax
						CrazyMax