Update action to support with tag_prefix parameter

This commit is contained in:
Sefa Şentürk
2024-08-30 11:05:23 +02:00
parent c1faa9d742
commit 56f4a516dd
6 changed files with 100 additions and 7 deletions

View File

@@ -11,7 +11,11 @@ export LC_ALL=C.UTF-8
pcre_semver='^(?P<major>0|[1-9]\d*)\.(?P<minor>0|[1-9]\d*)\.(?P<patch>0|[1-9]\d*)(?:-(?P<prerelease>(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+(?P<buildmetadata>[0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$'
pcre_master_ver='^(?P<major>0|[1-9]\d*)\.(?P<minor>0|[1-9]\d*)\.(?P<patch>0|[1-9]\d*)$'
pcre_allow_vprefix="^v{0,1}${pcre_master_ver:1}"
# Extended regex to allow arbitrary prefixes before the semver
pcre_allow_prefix='^.*(?P<semver>'"${pcre_master_ver:1}"')$'
pcre_allow_vprefix="^v{0,1}${pcre_allow_prefix:1}"
pcre_old_calver='^(?P<major>0|[1-9]\d*)-0{0,1}(?P<minor>0|[0-9]\d*)-R(?P<patch>0|[1-9]\d*)$'
##==----------------------------------------------------------------------------
@@ -51,6 +55,15 @@ if [[ "${use_api}" == 'true' ]] ; then
fi
fi
# Check if the tag_prefix is set, and if not, set it to an empty string
tag_prefix="${tag_prefix:-}"
# Add a trailing @ to tag_prefix if it doesn't already end with one
if [[ -n "$tag_prefix" && "${tag_prefix: -1}" != "@" ]]; then
tag_prefix="${tag_prefix}@"
fi
##==----------------------------------------------------------------------------
## MacOS compatibility