From d078b9e1252648ce5e67126069c619f5e0d93bed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joakim=20M=C3=B6rling?= Date: Wed, 20 May 2026 12:28:16 +0200 Subject: [PATCH] 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. --- .forgejo/workflows/deploy.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.forgejo/workflows/deploy.yml b/.forgejo/workflows/deploy.yml index 98107ca..e14d37c 100644 --- a/.forgejo/workflows/deploy.yml +++ b/.forgejo/workflows/deploy.yml @@ -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 }}