Skip to content

Commit 39f20cb

Browse files
authored
Merge pull request #97 from crazy-max/fix-set-input
preserve quotes for set input fields
2 parents 794e8fa + 79237ba commit 39f20cb

File tree

5 files changed

+44
-3
lines changed

5 files changed

+44
-3
lines changed

.github/workflows/ci.yml

+21
Original file line numberDiff line numberDiff line change
@@ -244,3 +244,24 @@ jobs:
244244
working-directory: ${{ env.DESTDIR }}
245245
run: |
246246
cat sbom.spdx.json | jq
247+
248+
set:
249+
runs-on: ubuntu-latest
250+
services:
251+
registry:
252+
image: registry:2
253+
ports:
254+
- 5000:5000
255+
steps:
256+
-
257+
name: Checkout
258+
uses: actions/checkout@v3
259+
-
260+
name: Build
261+
uses: ./
262+
with:
263+
workdir: ./test/go
264+
set: |
265+
*.platform=linux/amd64
266+
*.output=type=image,"name=localhost:5000/name/app:v1.0.0,localhost:5000/name/app:latest",push=true
267+
*.tags=

__tests__/context.test.ts

+20
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,26 @@ describe('getArgs', () => {
265265
"--provenance", 'builder-id=foo'
266266
]
267267
],
268+
[
269+
9,
270+
'0.10.0',
271+
new Map<string, string>([
272+
['load', 'false'],
273+
['no-cache', 'false'],
274+
['push', 'false'],
275+
['pull', 'false'],
276+
['set', `*.platform=linux/amd64,linux/ppc64le,linux/s390x\n*.output=type=image,"name=moby/buildkit:v0.11.0,moby/buildkit:latest",push=true`],
277+
['targets', `"image-all"`],
278+
]),
279+
[
280+
'bake',
281+
'--set', '*.platform=linux/amd64,linux/ppc64le,linux/s390x',
282+
'--set', `*.output=type=image,"name=moby/buildkit:v0.11.0,moby/buildkit:latest",push=true`,
283+
'--metadata-file', path.join(tmpDir, 'metadata-file'),
284+
'--provenance', `mode=min,inline-only=true,builder-id=https://github.com/docker/build-push-action/actions/runs/123456789`,
285+
'image-all'
286+
]
287+
],
268288
])(
269289
'[%d] given %p with %p as inputs, returns %p',
270290
async (num: number, buildxVersion: string, inputs: Map<string, string>, expected: Array<string>) => {

dist/index.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/index.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/context.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ export async function getInputs(): Promise<Inputs> {
3232
provenance: BuildxInputs.getProvenanceInput('provenance'),
3333
push: core.getBooleanInput('push'),
3434
sbom: core.getInput('sbom'),
35-
set: Util.getInputList('set', {ignoreComma: true}),
35+
set: Util.getInputList('set', {ignoreComma: true, quote: false}),
3636
source: core.getInput('source')
3737
};
3838
}

0 commit comments

Comments
 (0)