Skip to content

Commit 06fcb92

Browse files
JusterZhuclaude
andcommitted
fix: make tag and release steps idempotent for re-runs
git tag with --force and git push --force so re-running the workflow with the same version doesn't block on an existing tag. Use || gh release edit as fallback if the release already exists. Co-Authored-By: Claude <noreply@anthropic.com>
1 parent f1406b7 commit 06fcb92

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

.github/workflows/publish-nuget.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,8 @@ jobs:
5959
git config user.name "github-actions"
6060
git config user.email "github-actions@github.com"
6161
TAG="v${{ inputs.version }}"
62-
git tag "$TAG"
63-
git push origin "$TAG"
62+
git tag --force "$TAG"
63+
git push --force origin "$TAG"
6464
6565
- name: Create GitHub Release
6666
env:
@@ -71,7 +71,10 @@ jobs:
7171
artifacts/*.nupkg \
7272
--title "$TAG" \
7373
--notes "Release of GeneralUpdate.Avalonia version **${{ inputs.version }}**" \
74-
--verify-tag
74+
--verify-tag || \
75+
gh release edit "$TAG" \
76+
--title "$TAG" \
77+
--notes "Release of GeneralUpdate.Avalonia version **${{ inputs.version }}**"
7578
7679
- name: Push NuGet package to NuGet.org (Trusted Publishing via OIDC)
7780
run: |

0 commit comments

Comments
 (0)