platforms input

Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
This commit is contained in:
CrazyMax 2022-09-22 11:54:00 +02:00
parent 2dfca373f3
commit f6efb5fcbb
No known key found for this signature in database
GPG key ID: 3248E46B6BB8C7F7
5 changed files with 64 additions and 20 deletions

View file

@ -29,6 +29,7 @@ export interface Inputs {
driver: string;
driverOpts: string[];
buildkitdFlags: string;
platforms: string[];
install: boolean;
use: boolean;
endpoint: string;
@ -44,6 +45,7 @@ export async function getInputs(): Promise<Inputs> {
driver: core.getInput('driver') || 'docker-container',
driverOpts: await getInputList('driver-opts', true),
buildkitdFlags: core.getInput('buildkitd-flags') || '--allow-insecure-entitlement security.insecure --allow-insecure-entitlement network.host',
platforms: await getInputList('platforms'),
install: core.getBooleanInput('install'),
use: core.getBooleanInput('use'),
endpoint: core.getInput('endpoint'),
@ -67,6 +69,9 @@ export async function getCreateArgs(inputs: Inputs, buildxVersion: string): Prom
args.push('--buildkitd-flags', inputs.buildkitdFlags);
}
}
if (inputs.platforms.length > 0) {
args.push('--platform', inputs.platforms.join(','));
}
if (inputs.use) {
args.push('--use');
}