|
|
|
@ -14,6 +14,7 @@ import * as handlebars from 'handlebars';
|
|
|
|
|
let _defaultContext, _tmpDir: string;
|
|
|
|
|
|
|
|
|
|
export interface Inputs {
|
|
|
|
|
addHost: string[];
|
|
|
|
|
allow: string[];
|
|
|
|
|
buildArgs: string[];
|
|
|
|
|
builder: string;
|
|
|
|
@ -67,6 +68,7 @@ export function tmpNameSync(options?: tmp.TmpNameOptions): string {
|
|
|
|
|
|
|
|
|
|
export async function getInputs(defaultContext: string): Promise<Inputs> {
|
|
|
|
|
return {
|
|
|
|
|
addHost: await getInputList('add-host'),
|
|
|
|
|
allow: await getInputList('allow'),
|
|
|
|
|
buildArgs: await getInputList('build-args', true),
|
|
|
|
|
builder: core.getInput('builder'),
|
|
|
|
@ -104,6 +106,9 @@ export async function getArgs(inputs: Inputs, defaultContext: string, buildxVers
|
|
|
|
|
|
|
|
|
|
async function getBuildArgs(inputs: Inputs, defaultContext: string, buildxVersion: string): Promise<Array<string>> {
|
|
|
|
|
let args: Array<string> = ['build'];
|
|
|
|
|
if (inputs.addHost.length > 0) {
|
|
|
|
|
args.push('--add-host', inputs.addHost.join(','));
|
|
|
|
|
}
|
|
|
|
|
if (inputs.allow.length > 0) {
|
|
|
|
|
args.push('--allow', inputs.allow.join(','));
|
|
|
|
|
}
|
|
|
|
|