From 316d5eb8b36ac980db6c29bb9372ed353cb272ef Mon Sep 17 00:00:00 2001 From: ruslandoga <67764432+ruslandoga@users.noreply.github.com> Date: Fri, 13 Jan 2023 12:51:11 +0700 Subject: [PATCH] build-args newline split Signed-off-by: ruslandoga <67764432+ruslandoga@users.noreply.github.com> --- __tests__/context.test.ts | 18 ++++++++++++++++++ src/context.ts | 2 +- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/__tests__/context.test.ts b/__tests__/context.test.ts index 4f476b6..df7aef8 100644 --- a/__tests__/context.test.ts +++ b/__tests__/context.test.ts @@ -517,6 +517,24 @@ nproc=3`], '--metadata-file', '/tmp/.docker-build-push-jest/metadata-file', 'https://github.com/docker/build-push-action.git#refs/heads/test-jest:subdir' ] + ], + [ + 17, + '0.8.2', + new Map([ + ['build-args', 'BUILD_INFO={"tags":["ghcr.io/ghost/docker-build-info:master","ghcr.io/ghost/docker-build-info:59d6c0f","ghcr.io/ghost/docker-build-info:master-59d6c0f"]}'], + ['load', 'false'], + ['no-cache', 'false'], + ['push', 'false'], + ['pull', 'false'], + ]), + [ + 'build', + '--build-arg', 'BUILD_INFO={"tags":["ghcr.io/ghost/docker-build-info:master","ghcr.io/ghost/docker-build-info:59d6c0f","ghcr.io/ghost/docker-build-info:master-59d6c0f"]}', + '--iidfile', '/tmp/.docker-build-push-jest/iidfile', + '--metadata-file', '/tmp/.docker-build-push-jest/metadata-file', + 'https://github.com/docker/build-push-action.git#refs/heads/test-jest' + ] ] ])( '[%d] given %p with %p as inputs, returns %p', diff --git a/src/context.ts b/src/context.ts index b820583..13be614 100644 --- a/src/context.ts +++ b/src/context.ts @@ -73,7 +73,7 @@ export async function getInputs(defaultContext: string): Promise { addHosts: await getInputList('add-hosts'), allow: await getInputList('allow'), attests: await getInputList('attests', true), - buildArgs: await getInputList('build-args', true), + buildArgs: core.getMultilineInput('build-args'), buildContexts: await getInputList('build-contexts', true), builder: core.getInput('builder'), cacheFrom: await getInputList('cache-from', true),