Skip to content

Commit bf2e739

Browse files
authored
Merge pull request #1239 from kernelkit/ci-improvements
CI: Allow upstream caller to run pre build script [skip ci]
2 parents f45344d + 0b8d330 commit bf2e739

File tree

3 files changed

+25
-1
lines changed

3 files changed

+25
-1
lines changed

.github/workflows/build.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,15 @@ on:
3636
required: false
3737
type: boolean
3838
default: true
39+
pre_build_script:
40+
required: false
41+
type: string
42+
default: ''
43+
description: 'Optional script to run after checkout (for spin customization)'
44+
secrets:
45+
CHECKOUT_TOKEN:
46+
required: false
47+
description: 'Token for cross-repository access'
3948

4049
env:
4150
NAME: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.name || inputs.name }}
@@ -77,6 +86,16 @@ jobs:
7786
clean: true
7887
fetch-depth: 0
7988
submodules: recursive
89+
token: ${{ secrets.CHECKOUT_TOKEN || github.token }}
90+
91+
- name: Run pre-build script
92+
if: ${{ inputs.pre_build_script != '' }}
93+
run: |
94+
cat > ./pre-build.sh << 'EOF'
95+
${{ inputs.pre_build_script }}
96+
EOF
97+
chmod +x ./pre-build.sh
98+
bash ./pre-build.sh
8099
81100
- name: Set Build Variables
82101
id: vars

.github/workflows/test.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@ on:
2929
required: false
3030
type: string
3131
default: 'test'
32+
secrets:
33+
CHECKOUT_TOKEN:
34+
required: false
35+
description: 'Token for cross-repository access'
3236

3337
env:
3438
TARGET: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.target || inputs.target }}
@@ -59,6 +63,7 @@ jobs:
5963
clean: true
6064
fetch-depth: 0
6165
submodules: recursive
66+
token: ${{ secrets.CHECKOUT_TOKEN || github.token }}
6267

6368
- name: Set Build Variables
6469
id: vars

buildroot

Submodule buildroot updated 226 files

0 commit comments

Comments
 (0)