File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 6565 - name : Checkout repository
6666 uses : actions/checkout@v4
6767 with :
68- fetch-tags : true
68+ fetch-depth : 0
6969
7070 - name : Download converted files
7171 if : needs.convert.result == 'success'
@@ -115,7 +115,11 @@ jobs:
115115 ENCODED_MINOR=$(( P_MAJOR * 10000 + P_MINOR * 100 + P_PATCH ))
116116 echo "encoded_minor=$ENCODED_MINOR" >> "$GITHUB_OUTPUT"
117117
118- LATEST_TAG=$(git tag --list '[0-9]*' --sort=-v:refname | head -n1)
118+ # Use gh to list releases (authoritative, includes tags from previous runs)
119+ LATEST_TAG=$(gh release list --limit 1 --json tagName --jq '.[0].tagName' 2>/dev/null || true)
120+ if [ -z "$LATEST_TAG" ]; then
121+ LATEST_TAG=$(git tag --list '[0-9]*' --sort=-v:refname | head -n1)
122+ fi
119123
120124 if [ -n "$LATEST_TAG" ]; then
121125 CURRENT_MAJOR=$(echo "$LATEST_TAG" | cut -d. -f1)
@@ -149,6 +153,12 @@ jobs:
149153 TAG="${MAJOR}.${ENCODED_MINOR}.${NEXT_PATCH}"
150154 fi
151155
156+ # Safety: if this tag already exists, bump patch until unique
157+ while git tag --list "$TAG" | grep -q . || gh release view "$TAG" &>/dev/null; do
158+ PATCH=$(echo "$TAG" | cut -d. -f3)
159+ TAG="$(echo "$TAG" | cut -d. -f1-2).$((PATCH + 1))"
160+ done
161+
152162 echo "tag=$TAG" >> "$GITHUB_OUTPUT"
153163 echo "Release tag: $TAG (@untitledui/icons v$UNTITLED_VERSION)"
154164
You can’t perform that action at this time.
0 commit comments