From 6634a99c32fe9f33629575617bab05d5b988b4c3 Mon Sep 17 00:00:00 2001 From: Natalie Arellano Date: Thu, 9 Apr 2020 16:18:59 -0400 Subject: [PATCH] Derive pack version from branch name Note, for pull requests the branch name is the source branch, not the target. Thus for PRs the pack version will be 0.0.0. Signed-off-by: Natalie Arellano --- .github/workflows/build.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 7607e9144..8f6ae696c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -49,6 +49,11 @@ jobs: run: make verify - name: Test run: make test + - name: Derive pack version from branch name + run: | + [[ $GITHUB_REF =~ ^refs\/heads\/release/(.*)$ ]] && version=${BASH_REMATCH[1]} || version=0.0.0 + echo "::set-env name=PACK_VERSION::$version" + shell: bash - name: Build run: make build env: