diff --git a/.github/workflows/bump-version-and-create-release-and-push-docker-images.yaml b/.github/workflows/bump-version-and-create-release-and-push-docker-images.yaml index 0a45ee3e..9d4f5461 100644 --- a/.github/workflows/bump-version-and-create-release-and-push-docker-images.yaml +++ b/.github/workflows/bump-version-and-create-release-and-push-docker-images.yaml @@ -21,8 +21,8 @@ jobs: - name: Compute new version id: bump_version run: | - initial_version=$(source version && echo ${VERSION#v}) - new_version=$(.github/workflows/compute_version.sh "$initial_version" "${{ github.event.pull_request.body }}") + source version + new_version=$(.github/workflows/compute_version.sh "$VERSION" "${{ github.event.pull_request.body }}") echo "new_version=$new_version" >> $GITHUB_OUTPUT update-version-file: diff --git a/.github/workflows/compute_version.sh b/.github/workflows/compute_version.sh index 19bd1e87..f72af2f9 100755 --- a/.github/workflows/compute_version.sh +++ b/.github/workflows/compute_version.sh @@ -7,10 +7,10 @@ if [[ $# -ne 2 ]]; then exit 1 fi -initial_version=${1//[^0-9.v]/} +initial_version=${1//[^0-9.]/} input_string=${2//[^a-zA-Z0-9#]/} -initial_major=$(echo "$initial_version" | cut -d'.' -f1 | cut -d'v' -f2) +initial_major=$(echo "$initial_version" | cut -d'.' -f1) initial_minor=$(echo "$initial_version" | cut -d'.' -f2) initial_patch=$(echo "$initial_version" | cut -d'.' -f3)