diff --git a/.github/workflows/build-release.yml b/.github/workflows/build-release.yml
index 1b0ce53636e14583b8ccec48a9b590b2496d56df..39b7cf8f36492a4b74488f9529b61ed8774dc87c 100644
--- a/.github/workflows/build-release.yml
+++ b/.github/workflows/build-release.yml
@@ -36,10 +36,11 @@ jobs:
       # Store the version, stripping any v-prefix
       - name: Write release version
         run: |
+          TAG=${{ github.ref_name }}
           {
-            echo "TAG=${{ github.ref_name }}"
-            echo "VERSION=${TAG#v}"
+            echo "TAG=$TAG"
             echo "COMPOSER_VERSION=$(composer config version)"
+            echo "VERSION=${TAG#v}"
           } >> "$GITHUB_ENV"
 
       - name: Validate composer.json and composer.lock