fix: overwrite existing git tag on deploy retry
The deploy workflow failed when re-running with the same version tag because Git rejects pushing a tag that already exists on the remote. - Delete local tag first (ignore if missing) - Delete remote tag first (ignore if missing) - Create and push the tag fresh This makes deploys idempotent: retrying a failed deploy with the same version (e.g., v0.1.0) will succeed by moving the tag to the current commit. For a new deploy, the delete commands silently do nothing.
This commit is contained in:
parent
5eb49c05a8
commit
d078b9e125
1 changed files with 2 additions and 0 deletions
|
|
@ -22,6 +22,8 @@ jobs:
|
|||
|
||||
- name: Tag version
|
||||
run: |
|
||||
git tag -d ${{ github.event.inputs.version }} 2>/dev/null || true
|
||||
git push origin --delete ${{ github.event.inputs.version }} 2>/dev/null || true
|
||||
git tag ${{ github.event.inputs.version }}
|
||||
git push origin ${{ github.event.inputs.version }}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue