Skip to content

Commit eeb5f5c

Browse files
authored
fix when passing multiple additional args (#22)
1 parent e7e9bd7 commit eeb5f5c

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

build/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4117,7 +4117,7 @@ async function diffAll(token, from, additionalArgs, headTag) {
41174117
"--check",
41184118
"--upload",
41194119
...(headTag ? ["--head-tag", headTag] : []),
4120-
...(additionalArgs ? [additionalArgs] : []),
4120+
...(additionalArgs ? [...additionalArgs.split(" ")] : []),
41214121
], {
41224122
env: Object.assign(Object.assign({}, process.env), { OPTIC_TOKEN: token }),
41234123
}, false);

src/__tests__/action.test.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,10 +95,11 @@ test("push event with additional-args", async () => {
9595
const assertDeepen = mockDeepen();
9696
const assertDiffAll = mockDiffAll("optic-token", "HEAD~1", false, [
9797
"--fail-on-untracked-openapi",
98+
"--generated",
9899
]);
99100

100101
const exitCode = await runAction("optic-token", "github-token", {
101-
additionalArgs: "--fail-on-untracked-openapi",
102+
additionalArgs: "--fail-on-untracked-openapi --generated",
102103
standardsFail: "true",
103104
eventName: "push",
104105
headRef: "refs/heads/main",

src/action.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ async function diffAll(
212212
"--check",
213213
"--upload",
214214
...(headTag ? ["--head-tag", headTag] : []),
215-
...(additionalArgs ? [additionalArgs] : []),
215+
...(additionalArgs ? [...additionalArgs.split(" ")] : []),
216216
],
217217
{
218218
env: {

0 commit comments

Comments
 (0)