From 20629994f41e9a824553309895c97d5e0e44c5d6 Mon Sep 17 00:00:00 2001 From: Christof Marti Date: Mon, 4 Mar 2024 12:59:16 +0100 Subject: [PATCH] Ignore spaces (#280) --- azdo-task/DevcontainersCi/src/main.ts | 4 ++-- common/src/dev-container-cli.ts | 2 +- github-action/src/main.ts | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/azdo-task/DevcontainersCi/src/main.ts b/azdo-task/DevcontainersCi/src/main.ts index e02ab6a4..78787123 100644 --- a/azdo-task/DevcontainersCi/src/main.ts +++ b/azdo-task/DevcontainersCi/src/main.ts @@ -67,7 +67,7 @@ export async function runMain(): Promise { relativeConfigFile && path.resolve(checkoutPath, relativeConfigFile); const resolvedImageTag = imageTag ?? 'latest'; - const imageTagArray = resolvedImageTag.split(','); + const imageTagArray = resolvedImageTag.split(/\s*,\s*/); const fullImageNameArray: string[] = []; for (const tag of imageTagArray) { fullImageNameArray.push(`${imageName}:${tag}`); @@ -255,7 +255,7 @@ export async function runPost(): Promise { return; } const imageTag = task.getInput('imageTag') ?? 'latest'; - const imageTagArray = imageTag.split(','); + const imageTagArray = imageTag.split(/\s*,\s*/); const platform = task.getInput('platform'); if (platform) { for (const tag of imageTagArray) { diff --git a/common/src/dev-container-cli.ts b/common/src/dev-container-cli.ts index 6e162820..a68a0323 100644 --- a/common/src/dev-container-cli.ts +++ b/common/src/dev-container-cli.ts @@ -178,7 +178,7 @@ async function devContainerBuild( ); } if (args.platform) { - commandArgs.push('--platform', args.platform); + commandArgs.push('--platform', args.platform.split(/\s*,\s*/).join(',')); } if (args.output) { commandArgs.push('--output', args.output); diff --git a/github-action/src/main.ts b/github-action/src/main.ts index 2362fbf1..3e98d59d 100644 --- a/github-action/src/main.ts +++ b/github-action/src/main.ts @@ -79,7 +79,7 @@ export async function runMain(): Promise { relativeConfigFile && path.resolve(checkoutPath, relativeConfigFile); const resolvedImageTag = imageTag ?? 'latest'; - const imageTagArray = resolvedImageTag.split(','); + const imageTagArray = resolvedImageTag.split(/\s*,\s*/); const fullImageNameArray: string[] = []; for (const tag of imageTagArray) { fullImageNameArray.push(`${imageName}:${tag}`); @@ -256,7 +256,7 @@ export async function runPost(): Promise { const imageTag = emptyStringAsUndefined(core.getInput('imageTag')) ?? 'latest'; - const imageTagArray = imageTag.split(','); + const imageTagArray = imageTag.split(/\s*,\s*/); if (!imageName) { if (pushOption) { // pushOption was set (and not to "never") - give an error that imageName is required