Skip to content

Commit

Permalink
Merge pull request #1 from Benbentwo/feature/vV-support
Browse files Browse the repository at this point in the history
Update entrypoint.sh
  • Loading branch information
Benbentwo authored Apr 27, 2020
2 parents 82324d3 + da3706d commit c5b1ed0
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,17 @@ fi

if [ ! -z $major ]
then
((a[0]++))
# Check for v in version (e.g. v1.0 not just 1.0)
if [[ ${major} =~ ([vV]?)([0-9]+) ]]
then
v="${BASH_REMATCH[1]}"
major_version=${BASH_REMATCH[2]}
((major_version++))
a[0]=${v}${major_version}
else
((a[0]++))
fi

a[1]=0
a[2]=0
fi
Expand All @@ -64,5 +74,5 @@ echo "${a[0]}.${a[1]}.${a[2]}"
version=$(echo "${a[0]}.${a[1]}.${a[2]}")

echo "::set-output name=version::${version}"

echo "::set-output name=stripped-version::${version}"

0 comments on commit c5b1ed0

Please sign in to comment.