mirror of
https://github.com/elgohr/Publish-Docker-Github-Action.git
synced 2026-03-12 18:07:12 -04:00
Don't update major, minor and patch version on pre-release
Fixes https://github.com/elgohr/Publish-Docker-Github-Action/issues/108
This commit is contained in:
@@ -98,7 +98,11 @@ translateDockerTag() {
|
||||
elif isOnDefaultBranch; then
|
||||
TAGS="latest"
|
||||
elif isGitTag && usesBoolean "${INPUT_TAG_SEMVER}" && isSemver "${GITHUB_REF}"; then
|
||||
TAGS=$(echo "${GITHUB_REF}" | sed -e "s/refs\/tags\///g" | sed -E "s/v?([0-9]+)\.([0-9]+)\.([0-9]+)(-[a-zA-Z]+(\.[0-9]+)?)?/\1.\2.\3\4 \1.\2\4 \1\4/g")
|
||||
if isPreRelease "${GITHUB_REF}"; then
|
||||
TAGS=$(echo "${GITHUB_REF}" | sed -e "s/refs\/tags\///g" | sed -E "s/v?([0-9]+)\.([0-9]+)\.([0-9]+)(-[a-zA-Z]+(\.[0-9]+)?)?/\1.\2.\3\4/g")
|
||||
else
|
||||
TAGS=$(echo "${GITHUB_REF}" | sed -e "s/refs\/tags\///g" | sed -E "s/v?([0-9]+)\.([0-9]+)\.([0-9]+)/\1.\2.\3\4 \1.\2\4 \1\4/g")
|
||||
fi
|
||||
elif isGitTag && usesBoolean "${INPUT_TAG_NAMES}"; then
|
||||
TAGS=$(echo "${GITHUB_REF}" | sed -e "s/refs\/tags\///g")
|
||||
elif isGitTag; then
|
||||
@@ -163,6 +167,10 @@ isSemver() {
|
||||
echo "${1}" | grep -Eq '^refs/tags/v?([0-9]+)\.([0-9]+)\.([0-9]+)(-[a-zA-Z]+(\.[0-9]+)?)?$'
|
||||
}
|
||||
|
||||
isPreRelease() {
|
||||
echo "${1}" | grep -Eq '-'
|
||||
}
|
||||
|
||||
useSnapshot() {
|
||||
local TIMESTAMP=`date +%Y%m%d%H%M%S`
|
||||
local SHORT_SHA=$(echo "${GITHUB_SHA}" | cut -c1-6)
|
||||
|
||||
Reference in New Issue
Block a user