From d46e60a8083af4f1e2cd8260602b37761defeeb9 Mon Sep 17 00:00:00 2001 From: Peter Nied Date: Wed, 2 Nov 2022 12:18:12 -0500 Subject: [PATCH] Support checkout out #.X branch types (#1179) Signed-off-by: Peter Nied --- .github/actions/install-dashboards/action.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/actions/install-dashboards/action.yml b/.github/actions/install-dashboards/action.yml index dc28a0213..18721933d 100644 --- a/.github/actions/install-dashboards/action.yml +++ b/.github/actions/install-dashboards/action.yml @@ -46,14 +46,16 @@ runs: - id: osd-version continue-on-error: true - run: echo "::set-output name=osd-version::$(cat package.json | jq '.opensearchDashboards.version' | cut -c 2-4)" + run: | + echo "::set-output name=osd-version::$(cat package.json | jq '.opensearchDashboards.version' | cut -c 2-4)" + echo "::set-output name=osd-x-version::$(cat package.json | jq '.opensearchDashboards.version' | cut -c 2-3)" working-directory: ${{ steps.determine-plugin-directory.outputs.plugin-directory }} shell: bash - id: branch-switch-if-possible continue-on-error: true # Defaults onto main if the branch switch doesn't work if: ${{ steps.osd-version.outputs.osd-version }} - run: git checkout ${{ steps.osd-version.outputs.osd-version }} -b v${{ steps.osd-version.outputs.osd-version }} + run: git checkout ${{ steps.osd-version.outputs.osd-version }} || git checkout ${{ steps.osd-version.outputs.osd-x-version }}x working-directory: ./OpenSearch-Dashboards shell: bash