Skip to content

Commit 5bb0d08

Browse files
committed
feat: add github generated SDK_VERSION
1 parent d9f4fad commit 5bb0d08

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

.github/workflows/build-wasm-internal.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,23 @@ jobs:
2323
- name: Checkout repo
2424
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
2525

26+
- name: Set version (PR)
27+
if: ${{ github.event_name == 'pull_request' }}
28+
run: |
29+
echo REF_NAME="${{ github.event.pull_request.head.ref }}" >> $GITHUB_ENV
30+
echo SHA="${{ github.event.pull_request.head.sha }}" >> $GITHUB_ENV
31+
32+
- name: Set env variables (Branch/Tag)
33+
if: ${{ github.event_name == 'push' }}
34+
run: |
35+
echo REF_NAME="${GITHUB_REF_NAME}" >> $GITHUB_ENV
36+
echo SHA="${GITHUB_SHA}" >> $GITHUB_ENV
37+
38+
- name: Set version
39+
run: |
40+
echo SDK_VERSION="${REF_NAME} (${SHA:0:7})" >> $GITHUB_ENV
41+
echo "SDK_VERSION=${SDK_VERSION}"
42+
2643
- name: Setup Node
2744
uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4
2845
with:

0 commit comments

Comments
 (0)