nerdexam
Microsoft

GH-200 · Question #30

You have exactly one Windows x64 self-hosted runner, and it is configured with custom tools. Which syntax could you use in the workflow to target that runner?

The correct answer is A. runs-on: [self-hosted, windows, x64]. Self-hosted runners are targeted using labels in the runs-on: key as an array. The syntax runs-on: [self-hosted, windows, x64] uses the three default labels automatically assigned to Windows x64 self-hosted runners, precisely targeting that runner. Options B and D use an…

Author and Maintain Workflows

Question

You have exactly one Windows x64 self-hosted runner, and it is configured with custom tools. Which syntax could you use in the workflow to target that runner?

Options

  • Aruns-on: [self-hosted, windows, x64]
  • Bself-hosted: [windows-x64]
  • Cruns-on: windows-latest
  • Dself-hosted: [windows, x64]

How the community answered

(51 responses)
  • A
    90% (46)
  • B
    2% (1)
  • C
    2% (1)
  • D
    6% (3)

Explanation

Self-hosted runners are targeted using labels in the runs-on: key as an array. The syntax runs-on: [self-hosted, windows, x64] uses the three default labels automatically assigned to Windows x64 self-hosted runners, precisely targeting that runner. Options B and D use an invalid self-hosted: key that does not exist in GitHub Actions syntax. Option C (windows-latest) targets GitHub-hosted runners, not your custom self-hosted runner with its specific tooling.

Topics

#Self-hosted runners#Workflow syntax#Runner labels#Targeting runners

Community Discussion

No community discussion yet for this question.

Full GH-200 Practice