GH-200 - Manage GitHub Actions for the enterprise - Section 4.4

Configure self-hosted runners and runner groups and scope their access to organisations and repositories.

Configure self-hosted runners and assign them to runner groups scoped to specific organisations and repositories. Apply runner labels to target jobs at the correct runner, and plan autoscaling approaches to match runner capacity to workload demand.

self-hosted runnersrunner groupsrunner labelsautoscaling

Practice question for this objective

Free sampleManage GitHub Actions for the enterprisehard

An organisation has self-hosted runners on two operating systems registered in one runner group that is available to all repositories. A workflow job must run only on the runners backed by graphics processing units, which carry a custom gpu label, while still being a self-hosted runner. How should the job target those machines?

jobs:
  train:
    runs-on: <target>
  • ASet runs-on to gpu-latest, because GitHub resolves the suffix to the newest self-hosted runner in the group that has been tagged with the gpu capability label.
  • BSet runs-on to a combined array of [self-hosted, gpu], because the job is then dispatched only to a self-hosted runner that also carries the gpu label rather than any available machine. Correct
  • CSet runs-on to gpu alone and rely on the runner group restriction, because membership of the group already guarantees that only graphics machines accept the job.
  • DSet runs-on to self-hosted and move the gpu requirement into a separate runner-group key on the job, because the group key filters runners by hardware capability label.
Target a specific self-hosted runner by listing every required label in the runs-on array so all labels must match. When runs-on is given an array of labels, a job is dispatched only to a runner that carries all of those labels. Combining the built-in self-hosted label with the custom gpu label guarantees the job lands on a self-hosted machine that also advertises gpu. A latest suffix has no meaning for self-hosted labels, the gpu label alone is less precise in a mixed group, and there is no separate job-level key that filters a runner group by capability label.

Why A is wrong: Tempting because version-style suffixes appear in runner labels, but a latest suffix is not how self-hosted labels resolve. There is no automatic newest-runner selection, and the value would simply fail to match any registered label.

Why B is correct: Listing multiple labels in the runs-on array requires a runner to match every label, so [self-hosted, gpu] selects only self-hosted machines that also advertise the gpu label, which is exactly the targeting required.

Why C is wrong: Tempting because the gpu label does point at the right machines, but omitting self-hosted is less precise and the group contains mixed runners, so the group membership alone does not guarantee a graphics machine receives the job.

Why D is wrong: Tempting because runner groups exist, but there is no job-level runner-group key that filters by label. Self-hosted runner targeting by capability is expressed entirely through the labels listed in runs-on.

See more GH-200 practice questions, answers explained.

More in this domain

Back to all Manage GitHub Actions for the enterprise objectives, or the GH-200 cert hub.

Examworthy is not affiliated with or endorsed by GitHub. Original, blueprint-aligned practice material only.