Skip to content

Commit 79ec2fb

Browse files
committed
CI: allow upstream caller to specify branch
Signed-off-by: Richard Alpe <[email protected]>
1 parent d2e2adf commit 79ec2fb

File tree

2 files changed

+22
-2
lines changed

2 files changed

+22
-2
lines changed

.github/workflows/build.yml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@ on:
1919
description: 'Repo to checkout (for spin overrides)'
2020
default: kernelkit/infix
2121
type: string
22+
infix_branch:
23+
description: 'Branch/tag/commit to checkout (for spin overrides)'
24+
default: ''
25+
type: string
2226

2327
workflow_call:
2428
inputs:
@@ -32,6 +36,11 @@ on:
3236
required: false
3337
type: string
3438
default: kernelkit/infix
39+
infix_branch:
40+
required: false
41+
type: string
42+
default: ''
43+
description: 'Branch/tag/commit to checkout (for spin overrides). Defaults to github.ref if not specified'
3544
parallel:
3645
required: false
3746
type: boolean
@@ -50,6 +59,7 @@ env:
5059
NAME: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.name || inputs.name }}
5160
TARGET: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.target || inputs.target }}
5261
INFIX_REPO: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.infix_repo || inputs.infix_repo }}
62+
INFIX_BRANCH: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.infix_branch || inputs.infix_branch }}
5363

5464
jobs:
5565
build:
@@ -82,7 +92,7 @@ jobs:
8292
uses: actions/checkout@v4
8393
with:
8494
repository: ${{ env.INFIX_REPO }}
85-
ref: ${{ github.ref }}
95+
ref: ${{ env.INFIX_BRANCH != '' && env.INFIX_BRANCH || github.ref }}
8696
clean: true
8797
fetch-depth: 0
8898
submodules: recursive

.github/workflows/test.yml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ on:
88
required: false
99
default: kernelkit/infix
1010
type: string
11+
infix_branch:
12+
description: 'Branch/tag/commit to checkout (for spin overrides)'
13+
default: ''
14+
type: string
1115

1216
workflow_call:
1317
inputs:
@@ -21,6 +25,11 @@ on:
2125
required: false
2226
type: string
2327
default: kernelkit/infix
28+
infix_branch:
29+
required: false
30+
type: string
31+
default: ''
32+
description: 'Branch/tag/commit to checkout (for spin overrides). Defaults to github.ref if not specified'
2433
ninepm-conf:
2534
required: false
2635
type: string
@@ -42,6 +51,7 @@ on:
4251
env:
4352
TARGET: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.target || inputs.target }}
4453
INFIX_REPO: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.infix_repo || inputs.infix_repo }}
54+
INFIX_BRANCH: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.infix_branch || inputs.infix_branch }}
4555
NINEPM_CONF: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.ninepm-conf || inputs.ninepm-conf }}
4656
TEST_PATH: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.test-path || inputs.test-path }}
4757

@@ -64,7 +74,7 @@ jobs:
6474
uses: actions/checkout@v4
6575
with:
6676
repository: ${{ env.INFIX_REPO }}
67-
ref: ${{ github.ref }}
77+
ref: ${{ env.INFIX_BRANCH != '' && env.INFIX_BRANCH || github.ref }}
6878
clean: true
6979
fetch-depth: 0
7080
submodules: recursive

0 commit comments

Comments
 (0)