Skip to content

Commit 87abc0d

Browse files
committed
fix: release tag rename — use databaseId and rename before tag deletion
1 parent b79ad49 commit 87abc0d

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

.github/workflows/release.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -52,15 +52,15 @@ jobs:
5252
OLD_TAG="aicodeman@${VERSION}"
5353
NEW_TAG="codeman@${VERSION}"
5454
55-
# Retag
56-
git tag "$NEW_TAG" "$OLD_TAG" 2>/dev/null || true
57-
git tag -d "$OLD_TAG" 2>/dev/null || true
58-
git push origin "$NEW_TAG" ":refs/tags/$OLD_TAG" 2>/dev/null || true
59-
60-
# Update the GitHub release to use the new tag
61-
RELEASE_ID=$(gh release view "$OLD_TAG" --json id -q .id 2>/dev/null || true)
55+
# Update the GitHub release BEFORE deleting the old tag
56+
RELEASE_ID=$(gh release view "$OLD_TAG" --json databaseId -q .databaseId 2>/dev/null || true)
6257
if [ -n "$RELEASE_ID" ]; then
6358
gh api -X PATCH "repos/${{ github.repository }}/releases/${RELEASE_ID}" \
6459
-f tag_name="$NEW_TAG" \
6560
-f name="$NEW_TAG"
6661
fi
62+
63+
# Retag
64+
git tag "$NEW_TAG" "$OLD_TAG" 2>/dev/null || true
65+
git tag -d "$OLD_TAG" 2>/dev/null || true
66+
git push origin "$NEW_TAG" ":refs/tags/$OLD_TAG" 2>/dev/null || true

0 commit comments

Comments
 (0)