fix(ci): honor source_branch in promote-main-to-next

Add workflow_dispatch input (default main) so validation and the next
reset use the selected tip instead of a hardcoded main ref.
This commit is contained in:
Maxim Isaev
2026-05-04 17:53:32 +03:00
parent 4fce491974
commit 9c82d856cc
+12 -5
View File
@@ -3,6 +3,11 @@ name: Promote main to next
on: on:
workflow_dispatch: workflow_dispatch:
inputs: inputs:
source_branch:
description: "Source branch to promote into next (default main)"
required: false
default: main
type: string
source_only: source_only:
description: "Create/refresh tagged release only (skip platform builds and verify-nix)" description: "Create/refresh tagged release only (skip platform builds and verify-nix)"
required: false required: false
@@ -13,7 +18,7 @@ jobs:
validate-main: validate-main:
uses: ./.github/workflows/validate-main-green-ci.yml uses: ./.github/workflows/validate-main-green-ci.yml
with: with:
branch: main branch: ${{ inputs.source_branch }}
required_contexts: ci-ok|ci-main / ci-ok required_contexts: ci-ok|ci-main / ci-ok
promote: promote:
@@ -22,6 +27,8 @@ jobs:
permissions: permissions:
contents: write contents: write
actions: write actions: write
env:
SOURCE_BRANCH: ${{ inputs.source_branch }}
steps: steps:
- uses: actions/checkout@v5 - uses: actions/checkout@v5
with: with:
@@ -31,12 +38,12 @@ jobs:
uses: actions/setup-node@v5 uses: actions/setup-node@v5
with: with:
node-version: lts/* node-version: lts/*
- name: fast-forward next to main - name: fast-forward next to source branch tip
run: | run: |
set -euo pipefail set -euo pipefail
git fetch origin main next git fetch origin "$SOURCE_BRANCH" next
# Reset channel branch to main snapshot, then create a fresh RC bump commit. # Reset channel branch to source snapshot, then create a fresh RC bump commit.
git reset --hard origin/main git reset --hard "origin/$SOURCE_BRANCH"
- name: bump package version to next RC - name: bump package version to next RC
run: | run: |
set -euo pipefail set -euo pipefail