From c6b528b8be5f99cc6677250bbe92639a073ec779 Mon Sep 17 00:00:00 2001 From: Christian Byrne Date: Sat, 18 Oct 2025 13:04:49 -0700 Subject: [PATCH] [ci] allow manual workflow dispatch to do version bumping on core branches (rather than just on main) (#6117) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Summary Added configurable base branch selection to version bump workflows, enabling patch releases from `core/*` branches via GitHub Actions UI. ## Changes - **What**: Extended [workflow_dispatch inputs](https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#workflow_dispatch) with `branch` parameter for both main frontend and desktop-ui version bump workflows - **Validation**: Added branch existence check that lists available `core/*` branches on error - **Workflow modifications**: - `release-version-bump.yaml`: Checkout and create PRs targeting user-specified branch - `version-bump-desktop-ui.yaml`: Same behavior for desktop-ui releases ## Review Focus Branch validation logic correctly handles both local (`refs/heads/`) and remote (`refs/remotes/origin/`) refs. Default value preserves backward compatibility for release sheriffs unfamiliar with new feature. ## Use Case Previously, patch releases from `core/1.29` required manual version bumping. Now maintainers can trigger from Actions UI with dropdown selections. ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-6117-ci-allow-manual-workflow-dispatch-to-do-version-bumping-on-core-branches-rather-than-j-2906d73d365081cba3aff46471206a9e) by [Unito](https://www.unito.io) --- .github/workflows/release-version-bump.yaml | 27 ++++++++++++++++++- .../workflows/version-bump-desktop-ui.yaml | 26 +++++++++++++++++- 2 files changed, 51 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release-version-bump.yaml b/.github/workflows/release-version-bump.yaml index 337bf6975..5f3152285 100644 --- a/.github/workflows/release-version-bump.yaml +++ b/.github/workflows/release-version-bump.yaml @@ -15,6 +15,11 @@ on: required: false default: '' type: string + branch: + description: 'Base branch to bump (e.g., main, core/1.29, core/1.30)' + required: true + default: 'main' + type: string jobs: bump-version: @@ -26,6 +31,24 @@ jobs: steps: - name: Checkout repository uses: actions/checkout@v5 + with: + ref: ${{ github.event.inputs.branch }} + fetch-depth: 0 + + - name: Validate branch exists + run: | + BRANCH="${{ github.event.inputs.branch }}" + if ! git show-ref --verify --quiet "refs/heads/$BRANCH" && ! git show-ref --verify --quiet "refs/remotes/origin/$BRANCH"; then + echo "❌ Branch '$BRANCH' does not exist" + echo "" + echo "Available core branches:" + git branch -r | grep 'origin/core/' | sed 's/.*origin\// - /' || echo " (none found)" + echo "" + echo "Main branch:" + echo " - main" + exit 1 + fi + echo "✅ Branch '$BRANCH' exists" - name: Install pnpm uses: pnpm/action-setup@v4 @@ -59,7 +82,9 @@ jobs: title: ${{ steps.bump-version.outputs.NEW_VERSION }} body: | ${{ steps.capitalised.outputs.capitalised }} version increment to ${{ steps.bump-version.outputs.NEW_VERSION }} + + **Base branch:** `${{ github.event.inputs.branch }}` branch: version-bump-${{ steps.bump-version.outputs.NEW_VERSION }} - base: main + base: ${{ github.event.inputs.branch }} labels: | Release diff --git a/.github/workflows/version-bump-desktop-ui.yaml b/.github/workflows/version-bump-desktop-ui.yaml index 6d5d01c67..123cdbd9b 100644 --- a/.github/workflows/version-bump-desktop-ui.yaml +++ b/.github/workflows/version-bump-desktop-ui.yaml @@ -14,6 +14,11 @@ on: required: false default: '' type: string + branch: + description: 'Base branch to bump (e.g., main, core/1.29, core/1.30)' + required: true + default: 'main' + type: string jobs: bump-version-desktop-ui: @@ -26,8 +31,25 @@ jobs: - name: Checkout repository uses: actions/checkout@v5 with: + ref: ${{ github.event.inputs.branch }} + fetch-depth: 0 persist-credentials: false + - name: Validate branch exists + run: | + BRANCH="${{ github.event.inputs.branch }}" + if ! git show-ref --verify --quiet "refs/heads/$BRANCH" && ! git show-ref --verify --quiet "refs/remotes/origin/$BRANCH"; then + echo "❌ Branch '$BRANCH' does not exist" + echo "" + echo "Available core branches:" + git branch -r | grep 'origin/core/' | sed 's/.*origin\// - /' || echo " (none found)" + echo "" + echo "Main branch:" + echo " - main" + exit 1 + fi + echo "✅ Branch '$BRANCH' exists" + - name: Install pnpm uses: pnpm/action-setup@v4 with: @@ -64,8 +86,10 @@ jobs: title: desktop-ui ${{ steps.bump-version.outputs.NEW_VERSION }} body: | ${{ steps.capitalised.outputs.capitalised }} version increment for @comfyorg/desktop-ui to ${{ steps.bump-version.outputs.NEW_VERSION }} + + **Base branch:** `${{ github.event.inputs.branch }}` branch: desktop-ui-version-bump-${{ steps.bump-version.outputs.NEW_VERSION }} - base: main + base: ${{ github.event.inputs.branch }} labels: | Release