diff --git a/.github/workflows/release-candidate.yml b/.github/workflows/release-candidate.yml index 52425491..429f7a98 100644 --- a/.github/workflows/release-candidate.yml +++ b/.github/workflows/release-candidate.yml @@ -298,7 +298,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