Skip to content

Commit c2f6b39

Browse files
committed
fix(release): patch major tag instead of trying to POST
1 parent bab91a7 commit c2f6b39

1 file changed

Lines changed: 5 additions & 6 deletions

File tree

.github/workflows/release.yml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,8 @@ jobs:
5353
TAG="v${{ steps.semantic.outputs.release-major }}"
5454
SHA="${{ steps.semantic.outputs.git-head }}"
5555
56-
# Update or create the major version tag using GitHub API
57-
gh api --method POST /repos/${{ github.repository }}/git/refs \
58-
-f ref="refs/tags/${TAG}" \
59-
-f sha="${SHA}" \
60-
|| gh api --method PATCH /repos/${{ github.repository }}/git/refs/tags/${TAG} \
61-
-f sha="${SHA}" -F force=true
56+
# Update existing major tag or create it (update first to avoid "Reference already exists")
57+
gh api --method PATCH /repos/${{ github.repository }}/git/refs/tags/${TAG} \
58+
-f sha="${SHA}" -F force=true \
59+
|| gh api --method POST /repos/${{ github.repository }}/git/refs \
60+
-f ref="refs/tags/${TAG}" -f sha="${SHA}"

0 commit comments

Comments
 (0)