From 13829c73948e63b26c58a60c58f355fb91c77198 Mon Sep 17 00:00:00 2001 From: mateofuentespombo Date: Sun, 4 Jan 2026 18:01:40 +0100 Subject: [PATCH] Fix: delete existing release branch before creating new one --- .github/workflows/auto-release.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.github/workflows/auto-release.yml b/.github/workflows/auto-release.yml index 170a181..89e200b 100644 --- a/.github/workflows/auto-release.yml +++ b/.github/workflows/auto-release.yml @@ -98,8 +98,17 @@ jobs: echo "✅ Tag '$TAG' does not exist" - name: 'đŸŒŋ Create release branch' + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | BRANCH="${{ steps.version.outputs.branch_name }}" + + # Delete existing release branch if it exists (from a previous failed run) + if git ls-remote --heads origin "$BRANCH" | grep -q "$BRANCH"; then + echo "â„šī¸ Branch '$BRANCH' already exists, deleting it..." + gh api -X DELETE "repos/${{ github.repository }}/git/refs/heads/$BRANCH" || true + fi + git checkout -b "$BRANCH" - name: '📝 Update version in TelegramDownloader.csproj'