Skip to content

Commit

Permalink
Merge pull request #97 from crazy-max/fix-set-input
Browse files Browse the repository at this point in the history
preserve quotes for set input fields
  • Loading branch information
crazy-max authored Apr 17, 2023
2 parents 794e8fa + 79237ba commit 39f20cb
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 3 deletions.
21 changes: 21 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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=
20 changes: 20 additions & 0 deletions __tests__/context.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,26 @@ describe('getArgs', () => {
"--provenance", 'builder-id=foo'
]
],
[
9,
'0.10.0',
new Map<string, string>([
['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<string, string>, expected: Array<string>) => {
Expand Down
2 changes: 1 addition & 1 deletion dist/index.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export async function getInputs(): Promise<Inputs> {
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')
};
}
Expand Down

0 comments on commit 39f20cb

Please sign in to comment.