GH-200 Practice Test

Review 124 GH-200 practice questions with answer explanations and community insights.

Question 1

Which statement accurately describes using labels to route GitHub Actions workflows to runners?

  1. A user can assign multiple labels to a self-hosted runner and use the labels in a runs-on to target only runners that match all the specified labels.
  2. Labels apply only to GitHub-hosted runners and are ignored by self-hosted runners.
  3. GitHub Actions automatically assigns the runner's IP address as a label, and the label must be used in a runs-on.
  4. To target a specific runner, the runs-on must match the runner's hostname rather than its labels.

Question 2

For which type of GitHub Actions workflows should you use a self-hosted runner?

  1. workflows on a wide range of open-source software preinstalled in a GitHub-hosted environment
  2. workflows in environments that have specific hardware or operating system requirements that are unavailable on a GitHub-hosted runner
  3. workflows that require high availability and automatic scaling
  4. workflows that have standard configurations and frequent GitHub updates

Question 3

Which two actions ensure that a GitHub Actions workflow can be triggered manually? Each correct answer presents a complete solution. NOTE: Each correct selection is worth one point.

  1. Define a workflow_dispatch event and specify inputs that enable users to provide values when triggering the workflow manually.
  2. Use a schedule event and add a manual: false parameter.
  3. Define a workflow_dispatch event in the on field of the workflow YAML file.
  4. Trigger a workflow manually by using a workflow_call event that has a button on the UI.

Question 4

Which native method should you use to pass files between jobs within the same GitHub Actions workflow?

  1. Use artifact storage.
  2. Use job outputs.
  3. Use the copy action with the cache parameter to cache the data.
  4. Use an external blob store

Question 5

As a developer, what is the safest way to reference an action to prevent modification of the underlying code?

  1. Use a commit hash.
  2. Use a branch name.
  3. Use a major release tag.
  4. Use a patch release tag.