diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6b2ef61..7ba9340 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -244,3 +244,24 @@ jobs: working-directory: ${{ env.DESTDIR }} run: | cat sbom.spdx.json | jq + + set: + runs-on: ubuntu-latest + services: + registry: + image: registry:2 + ports: + - 5000:5000 + steps: + - + name: Checkout + uses: actions/checkout@v3 + - + name: Build + uses: ./ + with: + workdir: ./test/go + set: | + *.platform=linux/amd64 + *.output=type=image,"name=localhost:5000/name/app:v1.0.0,localhost:5000/name/app:latest",push=true + *.tags= diff --git a/__tests__/context.test.ts b/__tests__/context.test.ts index cfee5eb..da8808c 100644 --- a/__tests__/context.test.ts +++ b/__tests__/context.test.ts @@ -265,6 +265,26 @@ describe('getArgs', () => { "--provenance", 'builder-id=foo' ] ], + [ + 9, + '0.10.0', + new Map([ + ['load', 'false'], + ['no-cache', 'false'], + ['push', 'false'], + ['pull', 'false'], + ['set', `*.platform=linux/amd64,linux/ppc64le,linux/s390x\n*.output=type=image,"name=moby/buildkit:v0.11.0,moby/buildkit:latest",push=true`], + ['targets', `"image-all"`], + ]), + [ + 'bake', + '--set', '*.platform=linux/amd64,linux/ppc64le,linux/s390x', + '--set', `*.output=type=image,"name=moby/buildkit:v0.11.0,moby/buildkit:latest",push=true`, + '--metadata-file', path.join(tmpDir, 'metadata-file'), + '--provenance', `mode=min,inline-only=true,builder-id=https://github.com/docker/build-push-action/actions/runs/123456789`, + 'image-all' + ] + ], ])( '[%d] given %p with %p as inputs, returns %p', async (num: number, buildxVersion: string, inputs: Map, expected: Array) => { diff --git a/src/context.ts b/src/context.ts index 4142151..89b38fe 100644 --- a/src/context.ts +++ b/src/context.ts @@ -32,7 +32,7 @@ export async function getInputs(): Promise { provenance: BuildxInputs.getProvenanceInput('provenance'), push: core.getBooleanInput('push'), sbom: core.getInput('sbom'), - set: Util.getInputList('set', {ignoreComma: true}), + set: Util.getInputList('set', {ignoreComma: true, quote: false}), source: core.getInput('source') }; }