Skip to content

Commit

Permalink
default tag 0.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
obezpalko committed May 23, 2024
1 parent bf5b935 commit 269f0d2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions get-new-tag/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,13 @@ runs:
# getting latest parent taggithub.event.number
eval "$( git describe --tags --long --first-parent ${GITHUB_SHA} | sed -r 's/^((v?([0-9]+))(\.([0-9]+)(\.([0-9]+)(.*))?)?)-([0-9]+)-[0-9a-h]+$/parent_tag=\1;parent_prefix=\2;parent_major=\3;parent_minor=\5;parent_patch=\7;parent_extra=\8;parent_tag_offset=\9;/' )"
echo "offset ${parent_tag_offset}"
if [ $parent_tag_offset -eq 0 ] ; then
if [ "${parent_tag_offset}" -eq 0 ] ; then
# this commit already has tag
echo "tag=${parent_tag}" | tee -a "${GITHUB_OUTPUT}"
echo "skip_creation=true" | tee -a "${GITHUB_OUTPUT}"
exit
fi
new_tag="${parent_prefix}.${parent_minor:-0}.$(( ${parent_patch:-0} + ${{ inputs.increment }} ))${parent_extra}"
new_tag="${parent_prefix:-0}.${parent_minor:-0}.$(( ${parent_patch:-0} + ${{ inputs.increment }} ))${parent_extra}"
# check if new tag exist
tag="$( git tag --list "${new_tag}" )"
if [ -n "${tag}" ] ; then
Expand Down

0 comments on commit 269f0d2

Please sign in to comment.