Merge pull request #1074 from crazy-max/build-cmd-debug
Some checks failed
e2e / build (AWS ECR Public, AWS_SECRET_ACCESS_KEY, public.ecr.aws, public.ecr.aws/q3b5f1u4/test-docker-action, remote, AWS_ACCESS_KEY_ID) (push) Has been cancelled
e2e / build (AWS ECR, AWS_SECRET_ACCESS_KEY, 175142243308.dkr.ecr.us-east-2.amazonaws.com, 175142243308.dkr.ecr.us-east-2.amazonaws.com/sandbox/test-docker-action, remote, AWS_ACCESS_KEY_ID) (push) Has been cancelled
e2e / build (Azure Container Registry, AZURE_CLIENT_SECRET, officialgithubactions.azurecr.io, officialgithubactions.azurecr.io/test-docker-action, remote, AZURE_CLIENT_ID) (push) Has been cancelled
e2e / build (Docker Hub, DOCKERHUB_TOKEN, , ghactionstest/ghactionstest, remote, DOCKERHUB_USERNAME) (push) Has been cancelled
e2e / build (GitHub, GHCR_PAT, ghcr.io, ghcr.io/docker-ghactiontest/test, remote, GHCR_USERNAME) (push) Has been cancelled
e2e / build (GitLab, GITLAB_TOKEN, registry.gitlab.com, registry.gitlab.com/test1716/test, remote, GITLAB_USERNAME) (push) Has been cancelled
e2e / build (Google Artifact Registry, GAR_JSON_KEY, us-east4-docker.pkg.dev, us-east4-docker.pkg.dev/sandbox-298914/docker-official-github-actions/test-docker-action, remote, GAR_USERNAME) (push) Has been cancelled
e2e / build (Google Container Registry, GCR_JSON_KEY, gcr.io, gcr.io/sandbox-298914/test-docker-action, remote, GCR_USERNAME) (push) Has been cancelled
e2e / build (Quay, QUAY_TOKEN, quay.io, quay.io/docker_build_team/ghactiontest, remote, QUAY_USERNAME) (push) Has been cancelled
e2e / build (distribution, Distribution, local) (push) Has been cancelled
e2e / build (harbor, Harbor, local) (push) Has been cancelled
e2e / build (nexus, Nexus, local) (push) Has been cancelled

disable quotes detection for "outputs" input
This commit is contained in:
CrazyMax
2024-03-07 19:54:57 +01:00
committed by GitHub
5 changed files with 30 additions and 3 deletions

View File

@@ -705,6 +705,26 @@ ANOTHER_SECRET=ANOTHER_SECRET_ENV`]
'--metadata-file', path.join(tmpDir, 'metadata-file'),
'.'
]
],
[
29,
'0.12.0',
new Map<string, string>([
['context', '.'],
['outputs', `type=image,"name=localhost:5000/name/app:latest,localhost:5000/name/app:foo",push-by-digest=true,name-canonical=true,push=true`],
['load', 'false'],
['no-cache', 'false'],
['push', 'false'],
['pull', 'false'],
]),
[
'build',
'--iidfile', path.join(tmpDir, 'iidfile'),
"--output", `type=image,"name=localhost:5000/name/app:latest,localhost:5000/name/app:foo",push-by-digest=true,name-canonical=true,push=true`,
"--provenance", `mode=min,inline-only=true,builder-id=https://github.com/docker/build-push-action/actions/runs/123456789`,
'--metadata-file', path.join(tmpDir, 'metadata-file'),
'.'
]
]
])(
'[%d] given %p with %p as inputs, returns %p',

2
dist/index.js generated vendored

File diff suppressed because one or more lines are too long

2
dist/index.js.map generated vendored

File diff suppressed because one or more lines are too long

View File

@@ -60,7 +60,7 @@ export async function getInputs(): Promise<Inputs> {
network: core.getInput('network'),
noCache: core.getBooleanInput('no-cache'),
noCacheFilters: Util.getInputList('no-cache-filters'),
outputs: Util.getInputList('outputs', {ignoreComma: true}),
outputs: Util.getInputList('outputs', {ignoreComma: true, quote: false}),
platforms: Util.getInputList('platforms'),
provenance: BuildxInputs.getProvenanceInput('provenance'),
pull: core.getBooleanInput('pull'),

View File

@@ -17,6 +17,8 @@ actionsToolkit.run(
// main
async () => {
const inputs: context.Inputs = await context.getInputs();
core.debug(`inputs: ${JSON.stringify(inputs)}`);
const toolkit = new Toolkit();
await core.group(`GitHub Actions runtime token ACs`, async () => {
@@ -73,7 +75,12 @@ actionsToolkit.run(
});
const args: string[] = await context.getArgs(inputs, toolkit);
core.debug(`context.getArgs: ${JSON.stringify(args)}`);
const buildCmd = await toolkit.buildx.getCommand(args);
core.debug(`buildCmd.command: ${buildCmd.command}`);
core.debug(`buildCmd.args: ${JSON.stringify(buildCmd.args)}`);
await Exec.getExecOutput(buildCmd.command, buildCmd.args, {
ignoreReturnCode: true
}).then(res => {