File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed
Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -124,12 +124,19 @@ jobs:
124124 LATEST_TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo "v0.0.0")
125125 echo "Latest tag: $LATEST_TAG"
126126
127- # Increment patch version
127+ # Increment patch version until we find an available tag
128128 VERSION=${LATEST_TAG#v}
129129 IFS='.' read -r MAJOR MINOR PATCH <<< "$VERSION"
130130 NEW_PATCH=$((PATCH + 1))
131131 NEW_TAG="v${MAJOR}.${MINOR}.${NEW_PATCH}"
132132
133+ # Keep incrementing if tag already exists
134+ while git ls-remote --tags origin | grep -q "refs/tags/$NEW_TAG"; do
135+ echo "Tag $NEW_TAG already exists, incrementing..."
136+ NEW_PATCH=$((NEW_PATCH + 1))
137+ NEW_TAG="v${MAJOR}.${MINOR}.${NEW_PATCH}"
138+ done
139+
133140 echo "New tag: $NEW_TAG"
134141 echo "tag=$NEW_TAG" >> $GITHUB_OUTPUT
135142 echo "auto_generated=true" >> $GITHUB_OUTPUT
You can’t perform that action at this time.
0 commit comments