Skip to content

Commit ed1fc76

Browse files
jwaldripclaude
andcommitted
fix: make tag and release creation idempotent on workflow retries
Use git tag -f and git push -f for tags, and delete any existing release before creating to handle partial failure retries gracefully. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 269e285 commit ed1fc76

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

.github/workflows/bump-plugin-version.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,8 +140,8 @@ jobs:
140140
if: steps.commit.outputs.released == 'true'
141141
run: |
142142
TAG="v${{ steps.bump-version.outputs.new_version }}"
143-
git tag "$TAG"
144-
git push origin "$TAG"
143+
git tag -f "$TAG"
144+
git push -f origin "$TAG"
145145
146146
- name: Package plugin
147147
if: steps.commit.outputs.released == 'true'
@@ -174,6 +174,8 @@ jobs:
174174
run: |
175175
VERSION="${{ steps.bump-version.outputs.new_version }}"
176176
TAG="v${VERSION}"
177+
# Delete existing release on retry to ensure idempotency
178+
gh release delete "$TAG" -y 2>/dev/null || true
177179
gh release create "$TAG" \
178180
--title "$TAG" \
179181
--notes-file /tmp/release-notes.md \

0 commit comments

Comments
 (0)