Skip to content

Commit 1d91c71

Browse files
authored
Allow custom branch inputs for manual upmerge workflow (#131)
Adds optional inputs to workflow_dispatch allowing manual upmerge between any branches. Usage via CLI: ```bash gh workflow run upmerge_pr.yaml -f base_branch=hotfix-123 -f target_branch=1.1 ``` Empty inputs = default matrix (1.0 → 1.1).
2 parents 3477961 + 88e9020 commit 1d91c71

File tree

1 file changed

+33
-3
lines changed

1 file changed

+33
-3
lines changed

.github/workflows/upmerge_pr.yaml

Lines changed: 33 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,26 @@ on:
44
schedule:
55
-
66
cron: "0 2 * * *"
7-
workflow_dispatch: ~
7+
workflow_dispatch:
8+
inputs:
9+
base_branch:
10+
description: "Source branch (leave empty for default matrix)"
11+
required: false
12+
type: string
13+
target_branch:
14+
description: "Target branch (leave empty for default matrix)"
15+
required: false
16+
type: string
817

918
permissions:
1019
contents: write
1120
pull-requests: write
1221

1322
jobs:
14-
upmerge:
23+
# Scheduled runs or manual without inputs - use matrix
24+
upmerge-matrix:
25+
if: github.repository == 'Sylius/CmsPlugin' && !inputs.base_branch
1526
runs-on: ubuntu-latest
16-
if: github.repository == 'Sylius/CmsPlugin'
1727
name: "Upmerge PR"
1828
timeout-minutes: 5
1929
strategy:
@@ -36,3 +46,23 @@ jobs:
3646
base_branch: ${{ matrix.base_branch }}
3747
target_branch: ${{ matrix.target_branch }}
3848
token: ${{ secrets.SYLIUS_BOT_PAT }}
49+
50+
# Manual with custom inputs
51+
upmerge-custom:
52+
if: github.repository == 'Sylius/CmsPlugin' && inputs.base_branch
53+
runs-on: ubuntu-latest
54+
name: "Upmerge PR (${{ inputs.base_branch }} -> ${{ inputs.target_branch }})"
55+
timeout-minutes: 5
56+
57+
steps:
58+
-
59+
uses: actions/checkout@v4
60+
with:
61+
ref: ${{ inputs.target_branch }}
62+
63+
-
64+
uses: SyliusLabs/UpmergeAction@v1
65+
with:
66+
base_branch: ${{ inputs.base_branch }}
67+
target_branch: ${{ inputs.target_branch }}
68+
token: ${{ secrets.SYLIUS_BOT_PAT }}

0 commit comments

Comments
 (0)