Skip to content

armgit / cua

Public Imported from GitHub
0

Scale computer-use 2.0 with open-source drivers, cross-OS sandboxes, and benchmarks for training, evaluation, and data generation.

fix(workflows): fix CD PR creation and add retry resilience (#761)

Francesco Bonacci4036b386b306
diff --git a/.github/workflows/release-bump-version.yml b/.github/workflows/release-bump-version.yml
index d8eb24afd2..03b805f88b 100644
--- a/.github/workflows/release-bump-version.yml
+++ b/.github/workflows/release-bump-version.yml
@@ -309,12 +309,22 @@ jobs:
- name: Create release branch and PR
env:
- GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ GH_TOKEN: ${{ secrets.PR_TOKEN }}
run: |
# Get the tag that was created by bump2version
TAG=$(git describe --tags --abbrev=0)
BRANCH_NAME="release/${TAG}"
+ # Clean up any existing release branch from previous failed runs
+ git push origin --delete "$BRANCH_NAME" 2>/dev/null || true
+
+ # Close any existing PR for this branch
+ EXISTING_PR=$(gh pr list --head "$BRANCH_NAME" --json number --jq '.[0].number' 2>/dev/null || true)
+ if [ -n "$EXISTING_PR" ]; then
+ echo "Closing existing PR #$EXISTING_PR"
+ gh pr close "$EXISTING_PR" --delete-branch 2>/dev/null || true
+ fi
+
# Create and push the release branch
git checkout -b "$BRANCH_NAME"
git push origin "$BRANCH_NAME" --follow-tags