From 0958319e2eca591c3d3f356413b045f78b2785c0 Mon Sep 17 00:00:00 2001 From: Theo Truong Date: Mon, 1 Apr 2024 13:16:19 -0600 Subject: [PATCH] # Removed hard-coded params for merger Signed-off-by: Theo Truong --- .github/workflows/build-single-file-specs.yml | 4 +++- tools/merger/merge.ts | 6 ++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-single-file-specs.yml b/.github/workflows/build-single-file-specs.yml index bab421ac0..33a631235 100644 --- a/.github/workflows/build-single-file-specs.yml +++ b/.github/workflows/build-single-file-specs.yml @@ -17,7 +17,9 @@ jobs: working-directory: ./tools run: |- npm install - npm run merge + export ROOT_PATH=../spec/OpenSearch.openapi.yaml + export OUTPUT_PATH=../builds/OpenSearch.latest.yaml + npm run merge -- $ROOT_PATH $OUTPUT_PATH - name: Upload OpenAPI model artifact uses: actions/upload-artifact@v3 diff --git a/tools/merger/merge.ts b/tools/merger/merge.ts index 47eb4cbf1..a5e76d1e8 100644 --- a/tools/merger/merge.ts +++ b/tools/merger/merge.ts @@ -2,8 +2,10 @@ import OpenApiMerger from "./OpenApiMerger"; async function main() { - const merger = new OpenApiMerger('../spec/OpenSearch.openapi.yaml'); - merger.merge('../builds/OpenSearch.latest.yaml'); + const root_path: string = process.argv[2]; // '../spec/OpenSearch.openapi.yaml' + const output_path: string = process.argv[3]; // '../builds/OpenSearch.latest.yaml' + const merger = new OpenApiMerger(root_path); + merger.merge(output_path); } main(); \ No newline at end of file