Skip to content

Commit

Permalink
fix regex to find correct version
Browse files Browse the repository at this point in the history
  • Loading branch information
roflcoopter committed Apr 2, 2021
1 parent 071fb5a commit 72c9a87
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions azure-pipelines/templates/release_version.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ steps:
- script: |
set -e
branch="$(Build.SourceBranchName)"
echo Source branch is $branch
latestRelease=false
if [ "$branch" == "dev" ] ; then
Expand All @@ -19,6 +20,12 @@ steps:
echo "latest tag should also be pushed"
latestRelease=true
fi
elif [[ "$branch" =~ ^v[0-9]+\.[0-9]+\.[0-9]+.*$ ]] ; then
version=$([[ $branch =~ v(.*) ]] && echo "${BASH_REMATCH[1]}")
if [[ $version =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
echo "latest tag should also be pushed"
latestRelease=true
fi
else
echo "Failed to extract version from branch $branch"
exit 255
Expand Down

0 comments on commit 72c9a87

Please sign in to comment.