Skip to content

Commit d4365b8

Browse files
feat(pr): variable runner label
Define runs-on label with a repository variable and a fallback. This should allow us to override the runner label for PRs merging from origin branches.
1 parent f09c5a1 commit d4365b8

File tree

1 file changed

+19
-12
lines changed

1 file changed

+19
-12
lines changed

.github/workflows/pr.yaml

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -73,12 +73,19 @@ env:
7373
HTTPRequest
7474
HTTPResponse
7575
jobs:
76+
debug-runner-label:
77+
name: Debug Runner Label
78+
runs-on: ubuntu-24.04
79+
steps:
80+
- name: Debug Runner Label
81+
run: |
82+
echo "Runner label: ${{ vars.UBUNTU_X86_RUNNER_LABEL }}"
7683
#
7784
# DOC VERIFICATION
7885
#
7986
verify-docs:
8087
name: Verify Documentation
81-
runs-on: ubuntu-24.04
88+
runs-on: ${{ vars.UBUNTU_X86_RUNNER_LABEL || 'ubuntu-24.04' }}
8289
steps:
8390
- name: Checkout code
8491
uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
@@ -92,7 +99,7 @@ jobs:
9299
#
93100
verify-analyze-code:
94101
name: Verify and Analyze Code
95-
runs-on: ubuntu-24.04
102+
runs-on: ${{ vars.UBUNTU_X86_RUNNER_LABEL || 'ubuntu-24.04' }}
96103
container:
97104
image: alpine/git:2.49.1@sha256:bd54f921f6d803dfa3a4fe14b7defe36df1b71349a3e416547e333aa960f86e3
98105
steps:
@@ -134,7 +141,7 @@ jobs:
134141
name: Verify Other Tools
135142
needs:
136143
- verify-analyze-code
137-
runs-on: ubuntu-24.04
144+
runs-on: ${{ vars.UBUNTU_X86_RUNNER_LABEL || 'ubuntu-24.04' }}
138145
container:
139146
image: alpine/git:2.49.1@sha256:bd54f921f6d803dfa3a4fe14b7defe36df1b71349a3e416547e333aa960f86e3
140147
steps:
@@ -162,7 +169,7 @@ jobs:
162169
#
163170
detect-changes:
164171
name: Detect Changes
165-
runs-on: ubuntu-24.04
172+
runs-on: ${{ vars.UBUNTU_X86_RUNNER_LABEL || 'ubuntu-24.04' }}
166173
outputs:
167174
main: ${{ steps.detect.outputs.main }}
168175
types: ${{ steps.detect.outputs.types }}
@@ -227,7 +234,7 @@ jobs:
227234
needs:
228235
- detect-changes
229236
if: needs.detect-changes.outputs.main != 'true'
230-
runs-on: ubuntu-24.04
237+
runs-on: ${{ vars.UBUNTU_X86_RUNNER_LABEL || 'ubuntu-24.04' }}
231238
container:
232239
image: alpine/git:2.49.1@sha256:bd54f921f6d803dfa3a4fe14b7defe36df1b71349a3e416547e333aa960f86e3
233240
steps:
@@ -264,7 +271,7 @@ jobs:
264271
needs:
265272
- detect-changes
266273
if: needs.detect-changes.outputs.main != 'true'
267-
runs-on: ubuntu-24.04-arm
274+
runs-on: ${{ vars.UBUNTU_X86_RUNNER_LABEL || 'ubuntu-24.04-arm' }}
268275
container:
269276
image: alpine/git:2.49.1@sha256:bd54f921f6d803dfa3a4fe14b7defe36df1b71349a3e416547e333aa960f86e3
270277
volumes:
@@ -320,7 +327,7 @@ jobs:
320327
- verify-analyze-code
321328
- detect-changes
322329
if: needs.detect-changes.outputs.main == 'true'
323-
runs-on: ubuntu-24.04
330+
runs-on: ${{ vars.UBUNTU_X86_RUNNER_LABEL || 'ubuntu-24.04' }}
324331
container:
325332
image: alpine/git:2.49.1@sha256:bd54f921f6d803dfa3a4fe14b7defe36df1b71349a3e416547e333aa960f86e3
326333
steps:
@@ -343,7 +350,7 @@ jobs:
343350
- verify-analyze-code
344351
- detect-changes
345352
if: needs.detect-changes.outputs.main == 'true'
346-
runs-on: ubuntu-24.04-arm
353+
runs-on: ${{ vars.UBUNTU_X86_RUNNER_LABEL || 'ubuntu-24.04-arm' }}
347354
container:
348355
image: alpine/git:2.49.1@sha256:bd54f921f6d803dfa3a4fe14b7defe36df1b71349a3e416547e333aa960f86e3
349356
volumes:
@@ -383,7 +390,7 @@ jobs:
383390
- verify-analyze-code
384391
- detect-changes
385392
if: needs.detect-changes.outputs.main == 'true'
386-
runs-on: ubuntu-24.04
393+
runs-on: ${{ vars.UBUNTU_X86_RUNNER_LABEL || 'ubuntu-24.04' }}
387394
container:
388395
image: ubuntu:24.04@sha256:353675e2a41babd526e2b837d7ec780c2a05bca0164f7ea5dbbd433d21d166fc
389396
options: --pid=host --cgroupns=host --privileged -v /etc/os-release:/etc/os-release-host:ro -v /var/run:/var/run:ro -v /sys/kernel/debug:/sys/kernel/debug:rw -v /boot:/boot:ro
@@ -414,7 +421,7 @@ jobs:
414421
- verify-analyze-code
415422
- detect-changes
416423
if: needs.detect-changes.outputs.main == 'true'
417-
runs-on: ubuntu-24.04-arm
424+
runs-on: ${{ vars.UBUNTU_X86_RUNNER_LABEL || 'ubuntu-24.04-arm' }}
418425
container:
419426
image: ubuntu:24.04@sha256:353675e2a41babd526e2b837d7ec780c2a05bca0164f7ea5dbbd433d21d166fc
420427
options: --pid=host --cgroupns=host --privileged -v /etc/os-release:/etc/os-release-host:ro -v /var/run:/var/run:ro -v /sys/kernel/debug:/sys/kernel/debug:rw -v /boot:/boot:ro
@@ -448,7 +455,7 @@ jobs:
448455
- verify-analyze-code
449456
- detect-changes
450457
if: needs.detect-changes.outputs.main == 'true'
451-
runs-on: ubuntu-24.04
458+
runs-on: ${{ vars.UBUNTU_X86_RUNNER_LABEL || 'ubuntu-24.04' }}
452459
container:
453460
image: alpine/git:2.49.1@sha256:bd54f921f6d803dfa3a4fe14b7defe36df1b71349a3e416547e333aa960f86e3
454461
options: --pid=host --cgroupns=host --privileged -v /etc/os-release:/etc/os-release-host:ro -v /var/run:/var/run:ro
@@ -470,7 +477,7 @@ jobs:
470477
name: Generate Test Matrix
471478
needs:
472479
- detect-changes
473-
runs-on: ubuntu-24.04
480+
runs-on: ${{ vars.UBUNTU_X86_RUNNER_LABEL || 'ubuntu-24.04' }}
474481
if: needs.detect-changes.outputs.main == 'true'
475482
outputs:
476483
matrix01: ${{ steps.generate.outputs.matrix }}

0 commit comments

Comments
 (0)