1
0
This commit is contained in:
Stephan 2021-06-04 13:01:40 +02:00
parent efb5140d5b
commit ceb331236f

View File

@ -62,11 +62,17 @@ jobs:
HZVERSION=${HZTAG#v} HZVERSION=${HZTAG#v}
if [ "$HZVERSION" != "$HZTAG" ]; then # it is a version tag if [ "$HZVERSION" != "$HZTAG" ]; then # it is a version tag
echo "Triggered by version tag $HZTAG" echo "Triggered by version tag $HZTAG"
if (git show-ref --verify --quiet refs/heads/release/$HZVERSION && git tag --contains release/$HZVERSION | grep -q $HZTAG); then git fetch origin refs/heads/release/$HZVERSION:refs/heads/release/$HZVERSION
echo "Tag is in the correct branch" if [ $? -ne 0 ]; then
else echo "::error::Branch release/$HZVERSION does not exist"
echo "::error::Tag $HZTAG does not belong to branch release/$HZVERSION"
exit 1 exit 1
else
if (git tag --contains release/$HZVERSION | grep -q $HZTAG); then
echo "Tag is in the correct branch"
else
echo "::error::Tag $HZTAG does not belong to branch release/$HZVERSION"
exit 1
fi
fi fi
else else
echo "::error::Triggered by non-version tag $HZTAG" echo "::error::Triggered by non-version tag $HZTAG"