diff --git a/.github/workflows/_release.yml b/.github/workflows/_release.yml index 7eaa9410beb06..6dee08c652d1a 100644 --- a/.github/workflows/_release.yml +++ b/.github/workflows/_release.yml @@ -106,11 +106,16 @@ jobs: PREV_TAG=$(git tag --sort=-creatordate | grep -P $REGEX || true | head -1) fi - # confirm prev-tag actually exists in git repo with git tag - GIT_TAG_RESULT=$(git tag -l "$PREV_TAG") - if [ -z "$GIT_TAG_RESULT" ]; then - echo "Previous tag $PREV_TAG not found in git repo" - exit 1 + # if PREV_TAG is empty, let it be empty + if [ -z "$PREV_TAG" ]; then + echo "No previous tag found - first release" + else + # confirm prev-tag actually exists in git repo with git tag + GIT_TAG_RESULT=$(git tag -l "$PREV_TAG") + if [ -z "$GIT_TAG_RESULT" ]; then + echo "Previous tag $PREV_TAG not found in git repo" + exit 1 + fi fi