diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 7f71b633..6cc090cb 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -297,7 +297,10 @@ jobs: with: fetch-depth: 0 - name: Get version from branch - run: echo "PACKAGE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV + run: | + GITHUB_REF="${{ github.ref }}" + [[ -z "$GITHUB_REF" ]] && exit 1 # Fail if ref is unset + echo "PACKAGE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV - name: Buildah build id: build-image uses: redhat-actions/buildah-build@v2