A self-hosted runner carries labels 'self-hosted', 'linux', and 'gpu'. Which runs-on value requires the runner to match all listed labels?
Select an answer to reveal the explanation.
Short Explanation and Infographic
An array under runs-on is AND logic: the runner must have every listed label. There is no || or any() syntax for runs-on labels in workflow YAML.
Full explanation below image
Full Explanation
For self-hosted runners, runs-on can be a single label string or an array of labels. When you supply an array, GitHub selects a runner that has all of those labels (logical AND). runs-on: [self-hosted, linux, gpu] therefore targets machines labeled with each of those three. OR logic is not expressed with || inside runs-on; if you need alternative pools, you typically use separate jobs or a matrix of labels. any(...) is not valid runs-on syntax. A single string self-hosted,linux,gpu is treated as one literal label name including commas, which almost never matches. Also prefer not relying solely on the generic self-hosted label in large orgs; add purpose-specific labels and optionally runner groups for isolation.