Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,16 @@ jobs:
tag="v${new_ver}"
branch="release/${tag}"

# Skip if tag already exists (idempotent for re-runs)
if git ls-remote --tags origin "refs/tags/${tag}" | grep -q .; then
echo "::notice::Tag ${tag} already exists, skipping"
# Skip if a release PR already exists for this version
if gh pr list --head "${branch}" --json number --jq '.[0].number' 2>/dev/null | grep -q .; then
echo "::notice::Release PR for ${tag} already exists, skipping"
exit 0
fi

# Clean up stale tag/branch from any previous failed run
git push origin --delete "refs/tags/${tag}" 2>/dev/null || true
git push origin --delete "${branch}" 2>/dev/null || true

git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"

Expand Down
Loading