Skip to content

Commit 0cc6ad3

Browse files
authored
Correctly construct additional flags (#28)
This PR addresses an issue with the `flags` input being incorrectly interpreted. Fixes #27.
1 parent dd5701a commit 0cc6ad3

3 files changed

Lines changed: 3 additions & 4 deletions

File tree

action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ inputs:
8383
description: |-
8484
Space separated list of other Cloud Deploy flags, examples can be found:
8585
https://cloud.google.com/sdk/gcloud/reference/deploy/releases/create#FLAGS
86-
Example: --from-k8s-manifest=manifest.yaml
86+
Example: '--from-k8s-manifest=manifest.yaml --skaffold-version=skaffold_preview'
8787
required: false
8888

8989
gcloud_version:

src/main.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,6 @@ export async function run(): Promise<void> {
153153
if (flags) {
154154
const flagList = parseFlags(flags);
155155
if (flagList) {
156-
cmd.push('--flags');
157156
cmd = cmd.concat(flagList);
158157
}
159158
}

tests/unit/main.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -267,12 +267,12 @@ describe('#run', function () {
267267
});
268268

269269
it('sets flags if given', async function () {
270-
this.stubs.getInput.withArgs('flags').returns('flag1=value1,flag2=value2');
270+
this.stubs.getInput.withArgs('flags').returns('--flag1=value1 --flag2=value2');
271271
await run();
272272
const call = this.stubs.getExecOutput.getCall(0);
273273
expect(call).to.be;
274274
const args = call.args[1];
275-
expect(args).to.include.members(['--flags', 'flag1=value1,flag2=value2']);
275+
expect(args).to.include.members(['--flag1', 'value1', '--flag2', 'value2']);
276276
});
277277

278278
it('uses default components without gcloud_component flag', async function () {

0 commit comments

Comments
 (0)