Skip to content

Commit c6b528b

Browse files
[ci] allow manual workflow dispatch to do version bumping on core branches (rather than just on main) (#6117)
## 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)
1 parent 37d2f25 commit c6b528b

File tree

2 files changed

+51
-2
lines changed

2 files changed

+51
-2
lines changed

.github/workflows/release-version-bump.yaml

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,11 @@ on:
1515
required: false
1616
default: ''
1717
type: string
18+
branch:
19+
description: 'Base branch to bump (e.g., main, core/1.29, core/1.30)'
20+
required: true
21+
default: 'main'
22+
type: string
1823

1924
jobs:
2025
bump-version:
@@ -26,6 +31,24 @@ jobs:
2631
steps:
2732
- name: Checkout repository
2833
uses: actions/checkout@v5
34+
with:
35+
ref: ${{ github.event.inputs.branch }}
36+
fetch-depth: 0
37+
38+
- name: Validate branch exists
39+
run: |
40+
BRANCH="${{ github.event.inputs.branch }}"
41+
if ! git show-ref --verify --quiet "refs/heads/$BRANCH" && ! git show-ref --verify --quiet "refs/remotes/origin/$BRANCH"; then
42+
echo "❌ Branch '$BRANCH' does not exist"
43+
echo ""
44+
echo "Available core branches:"
45+
git branch -r | grep 'origin/core/' | sed 's/.*origin\// - /' || echo " (none found)"
46+
echo ""
47+
echo "Main branch:"
48+
echo " - main"
49+
exit 1
50+
fi
51+
echo "✅ Branch '$BRANCH' exists"
2952
3053
- name: Install pnpm
3154
uses: pnpm/action-setup@v4
@@ -59,7 +82,9 @@ jobs:
5982
title: ${{ steps.bump-version.outputs.NEW_VERSION }}
6083
body: |
6184
${{ steps.capitalised.outputs.capitalised }} version increment to ${{ steps.bump-version.outputs.NEW_VERSION }}
85+
86+
**Base branch:** `${{ github.event.inputs.branch }}`
6287
branch: version-bump-${{ steps.bump-version.outputs.NEW_VERSION }}
63-
base: main
88+
base: ${{ github.event.inputs.branch }}
6489
labels: |
6590
Release

.github/workflows/version-bump-desktop-ui.yaml

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,11 @@ on:
1414
required: false
1515
default: ''
1616
type: string
17+
branch:
18+
description: 'Base branch to bump (e.g., main, core/1.29, core/1.30)'
19+
required: true
20+
default: 'main'
21+
type: string
1722

1823
jobs:
1924
bump-version-desktop-ui:
@@ -26,8 +31,25 @@ jobs:
2631
- name: Checkout repository
2732
uses: actions/checkout@v5
2833
with:
34+
ref: ${{ github.event.inputs.branch }}
35+
fetch-depth: 0
2936
persist-credentials: false
3037

38+
- name: Validate branch exists
39+
run: |
40+
BRANCH="${{ github.event.inputs.branch }}"
41+
if ! git show-ref --verify --quiet "refs/heads/$BRANCH" && ! git show-ref --verify --quiet "refs/remotes/origin/$BRANCH"; then
42+
echo "❌ Branch '$BRANCH' does not exist"
43+
echo ""
44+
echo "Available core branches:"
45+
git branch -r | grep 'origin/core/' | sed 's/.*origin\// - /' || echo " (none found)"
46+
echo ""
47+
echo "Main branch:"
48+
echo " - main"
49+
exit 1
50+
fi
51+
echo "✅ Branch '$BRANCH' exists"
52+
3153
- name: Install pnpm
3254
uses: pnpm/action-setup@v4
3355
with:
@@ -64,8 +86,10 @@ jobs:
6486
title: desktop-ui ${{ steps.bump-version.outputs.NEW_VERSION }}
6587
body: |
6688
${{ steps.capitalised.outputs.capitalised }} version increment for @comfyorg/desktop-ui to ${{ steps.bump-version.outputs.NEW_VERSION }}
89+
90+
**Base branch:** `${{ github.event.inputs.branch }}`
6791
branch: desktop-ui-version-bump-${{ steps.bump-version.outputs.NEW_VERSION }}
68-
base: main
92+
base: ${{ github.event.inputs.branch }}
6993
labels: |
7094
Release
7195

0 commit comments

Comments
 (0)