From 07e1a5e198219b7ecab98d7188b48e8da2071aee Mon Sep 17 00:00:00 2001 From: David Cui Date: Mon, 18 Apr 2022 14:05:21 -0700 Subject: [PATCH] add step to fetch correct node version Signed-off-by: David Cui --- .../dashboards-reports-test-and-build-workflow.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/dashboards-reports-test-and-build-workflow.yml b/.github/workflows/dashboards-reports-test-and-build-workflow.yml index 400db797..6919bdca 100644 --- a/.github/workflows/dashboards-reports-test-and-build-workflow.yml +++ b/.github/workflows/dashboards-reports-test-and-build-workflow.yml @@ -22,10 +22,17 @@ jobs: ref: ${{ env.OPENSEARCH_VERSION }} path: dashboards-reports/OpenSearch-Dashboards + - name: Get node version + id: versions_step + run: + echo "::set-output name=node_version::$(node -p "(require('./OpenSearch-Dashboards/package.json').engines.node).match(/[.0-9]+/)[0]")" + - name: Setup Node uses: actions/setup-node@v1 with: - node-version: "14.18.2" + node-version: ${{ steps.versions_step.outputs.node_version }} + registry-url: 'https://registry.npmjs.org' + - name: Move Dashboards Reports to Plugins Dir run: mv dashboards-reports OpenSearch-Dashboards/plugins/${{ env.PLUGIN_NAME }}