Emit custom runs-on label arrays for self-hosted runners (#387) - #418
Merged
ChrisonSimtian merged 1 commit intoJun 29, 2026
Conversation
avidenic
marked this pull request as ready for review
June 21, 2026 13:15
ChrisonSimtian
approved these changes
Jun 22, 2026
Contributor
Author
|
@ChrisonSimtian build is finally green =) |
Collaborator
yeah i merged dennis' fix this morning 😬 happy merging |
avidenic
force-pushed
the
features/387-github-actions-runs-on-labels
branch
from
June 29, 2026 07:27
0b7c7b8 to
de885f2
Compare
Contributor
Author
Tnx! I do not seem to have an option to merge though. |
…ld#387) GitHubActionsJob.Write emitted runs-on: {Image.GetValue()} unconditionally, so a workflow could only target the fixed GitHubActionsImage enum. Self-hosted runner pools are selected by a label array (runs-on: [self-hosted, linux, x64]) which was impossible to produce. Add an additive string[] RunsOnLabels to GitHubActionsAttribute, plumb it through GetJobs onto GitHubActionsJob, and branch in Write: non-empty emits the array form via JoinCommaSpace(), otherwise the existing scalar path is unchanged. RunsOnLabels defaults empty, so existing usages generate byte-for-byte identical YAML. Validated at configuration-generation time: it requires exactly one image (a multi-image matrix is ambiguous) and rejects null/empty/whitespace entries that would emit malformed YAML. Covered by a runs-on-labels Verify snapshot and GitHubActionsRunsOnLabelsValidationTest.
avidenic
force-pushed
the
features/387-github-actions-runs-on-labels
branch
from
June 29, 2026 08:10
de885f2 to
2318fda
Compare
Collaborator
did you rebase? Should show you the merge option once you got everything green ticked. If your other PRs are blocked, just ping me and I'll have another look @avidenic |
This was referenced Aug 7, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #387.
What
Adds a public
RunsOnLabels(string[]) toGitHubActionsAttributeso a generated workflow can target a self-hosted runner pool by label array —runs-on: [self-hosted, linux, x64]— instead of only the fixedGitHubActionsImageenum scalar.How
GitHubActionsAttribute.RunsOnLabels(string[], defaults empty) → carried throughGetJobsonto a matchingGitHubActionsJob.RunsOnLabels.GitHubActionsJob.Writebranches: non-empty →runs-on: [a, b, c]viaJoinCommaSpace(); otherwise the existing scalarruns-on: {Image.GetValue()}path is untouched.RunsOnLabelsis set the image is ignored forruns-on:and only names the job.)runs-on: [a, ].Per the issue, the property is named
RunsOnLabels(not the fork's earlierRunsOnOptionalInputs). Job- and step-levelruns-onand anyGitHubActionsImageenum changes are out of scope.Backwards compatibility
Purely additive.
RunsOnLabelsdefaults to empty, so existing[GitHubActions(...)]usages generate byte-for-byte identical YAML (noruns-on:change). Non-breaking →target/2026, nobreaking-change.Testing
runs-on-labelsVerify snapshot inConfigurationGenerationTest— locks theruns-on: [self-hosted, linux, x64]array form; the existing scalar snapshots are unchanged, guarding the fallback path.GitHubActionsRunsOnLabelsValidationTest: matrix+labels throws; single-image+labels and matrix-without-labels don't; single label is valid; null/empty/whitespace element throws../build.sh Test Packis green locally, including theNuke.*transition-shim test projects that consume this public API.