Skip to content

Commit eb9e049

Browse files
committed
fix: handle re-runs by deleting existing release
1 parent 4e634a0 commit eb9e049

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

.github/workflows/release.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,17 @@ jobs:
175175
echo "$FORMATTED_CHANGELOG" >> $GITHUB_OUTPUT
176176
echo "EOF" >> $GITHUB_OUTPUT
177177
178+
- name: Delete existing release (if re-running)
179+
env:
180+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
181+
VERSION: ${{ steps.create_tag.outputs.new_tag }}
182+
run: |
183+
# Delete existing release if it exists (for re-runs)
184+
if gh release view $VERSION &>/dev/null; then
185+
echo "Deleting existing release $VERSION..."
186+
gh release delete $VERSION --yes --cleanup-tag=false
187+
fi
188+
178189
- name: Create Release
179190
env:
180191
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)