diff --git a/.github/workflows/deploy-release.yml b/.github/workflows/deploy-release.yml index ba475f05..4a12d88d 100644 --- a/.github/workflows/deploy-release.yml +++ b/.github/workflows/deploy-release.yml @@ -45,16 +45,22 @@ jobs: - name: Get current release identifier # shellcheck disable=SC2062 run: | - echo "RELEASE_VERSION=$(echo ${{ github.event.release.name }} \ - | grep -E -o "v[[:digit:]]+\.[[:digit:]]+\.[[:digit:]]+")" \ - >> "${GITHUB_ENV}" + RELESE_VERSION="$(echo ${{ github.event.release.name }} \ + | grep -E -o "v[[:digit:]]+\.[[:digit:]]+\.[[:digit:]]+")" + if [ -z "${RELEASE_VERSION}" ]; then echo "No release version found in environment, using input..." RELEASE_VERSION="${{ github.event.inputs.release_version }}" - echo "RELEASE_VERSION=${RELEASE_VERSION}" \ - >> "${GITHUB_ENV}" fi + + # Check the RELEASE_VERSION again + if [ -z "${RELEASE_VERSION}" ]; then + echo "Error RELEASE_VERSION is empty. Exiting..." + exit 1 + fi + { + echo "RELEASE_VERSION=${RELESE_VERSION}" echo "SEMVER_VERSION=${RELEASE_VERSION#v}" echo "SEMVER_MAJOR_VERSION=${SEMVER_VERSION%%.*}" echo "SEMVER_MAJOR_VERSION_WITH_PREFIX=v${SEMVER_MAJOR_VERSION}"