Skip to content

Commit

Permalink
fix when passing multiple additional args (#22)
Browse files Browse the repository at this point in the history
  • Loading branch information
niclim authored May 3, 2023
1 parent e7e9bd7 commit eeb5f5c
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion build/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4117,7 +4117,7 @@ async function diffAll(token, from, additionalArgs, headTag) {
"--check",
"--upload",
...(headTag ? ["--head-tag", headTag] : []),
...(additionalArgs ? [additionalArgs] : []),
...(additionalArgs ? [...additionalArgs.split(" ")] : []),
], {
env: Object.assign(Object.assign({}, process.env), { OPTIC_TOKEN: token }),
}, false);
Expand Down
3 changes: 2 additions & 1 deletion src/__tests__/action.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,11 @@ test("push event with additional-args", async () => {
const assertDeepen = mockDeepen();
const assertDiffAll = mockDiffAll("optic-token", "HEAD~1", false, [
"--fail-on-untracked-openapi",
"--generated",
]);

const exitCode = await runAction("optic-token", "github-token", {
additionalArgs: "--fail-on-untracked-openapi",
additionalArgs: "--fail-on-untracked-openapi --generated",
standardsFail: "true",
eventName: "push",
headRef: "refs/heads/main",
Expand Down
2 changes: 1 addition & 1 deletion src/action.ts
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ async function diffAll(
"--check",
"--upload",
...(headTag ? ["--head-tag", headTag] : []),
...(additionalArgs ? [additionalArgs] : []),
...(additionalArgs ? [...additionalArgs.split(" ")] : []),
],
{
env: {
Expand Down

0 comments on commit eeb5f5c

Please sign in to comment.