Assign RELEASE_VERSION before using it (#3413)

This commit is contained in:
Marco Ferrari 2022-10-04 20:35:11 +02:00 committed by GitHub
parent bb2d833b08
commit 4b6635f63b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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}"