From 154dbf1fcfca454921fc11f8b914f89f1c317522 Mon Sep 17 00:00:00 2001 From: Andreas Coroiu Date: Tue, 22 Oct 2024 10:30:01 +0200 Subject: [PATCH] feat: add github generated SDK_VERSION --- .github/workflows/build-wasm-internal.yml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/.github/workflows/build-wasm-internal.yml b/.github/workflows/build-wasm-internal.yml index 2262babc..818ee462 100644 --- a/.github/workflows/build-wasm-internal.yml +++ b/.github/workflows/build-wasm-internal.yml @@ -23,6 +23,23 @@ jobs: - name: Checkout repo uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 + - name: Set version (PR) + if: ${{ github.event_name == 'pull_request' }} + run: | + export REF_NAME="${{ github.event.pull_request.head.ref }}" + export SHA="${{ github.event.pull_request.head.sha }}" + + - name: Set env variables (Branch/Tag) + if: ${{ github.event_name == 'push' }} + run: | + export REF_NAME="${GITHUB_REF_NAME}" + export SHA="${GITHUB_SHA}" + + - name: Set version + run: | + export SDK_VERSION="${REF_NAME} (${SHA:0:7})" + echo "SDK_VERSION=$SDK_VERSION" + - name: Setup Node uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4 with: