Emit custom runs-on label arrays for self-hosted runners (#387)#418
Open
avidenic wants to merge 4 commits into
Open
Emit custom runs-on label arrays for self-hosted runners (#387)#418avidenic wants to merge 4 commits into
avidenic wants to merge 4 commits into
Conversation
…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.
ChrisonSimtian
approved these changes
Jun 22, 2026
…ctions-runs-on-labels # Conflicts: # tests/Fallout.Common.Tests/CI/ConfigurationGenerationTest.cs
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.Merge preference: (x) squash (default) ( ) rebase