GH-200 Practice Test practice questions, page 4 of 5, with answer review and explanations.
Question 16
As a developer, you are designing a workflow and need to communicate with the runner machine to set environment variables, output values used by other actions, add debug messages to the output logs, and other tasks. Which of the following options should you use?
composite run step
enable debug logging
self-hosted runners
environment variables
workflow commands
Question 17
When should you use the GITHUB_TOKEN in a workflow?
when you want to make authenticated calls to the GitHub API
when you want to connect to the runner via SSH
when you want to access repository-level secrets
when you want to call an action from the marketplace
Question 18
In which of the following scenarios should you use self-hosted runners? (Each correct answer presents a complete solution. Choose two.)
when the workflow jobs must be run on Windows 10
when jobs must run for longer than 6 hours
when a workflow job needs to install software from the local network
when GitHub Actions minutes must be used for the workflow runs
when you want to use macOS runners
Question 19
As a developer, you need to leverage Redis in your workflow. What is the best way to use Redis on a self-hosted Linux runner without affecting future workflow runs?
Install Redis on the hosted runner image and place it in a runner group. Specify label: in your job to target the runner group.
Set up Redis on a separate machine and reference that instance from your job.
Specify container: and services: in your job definition to leverage a Redis service container.
Add a run step to your workflow, which dynamically installs and configures Redis as part of your job.
Question 20
You installed specific software on a Linux self-hosted runner. You have users with workflows that need to be able to select the runner based on the identified custom software. Which steps should you perform to prepare the runner and your users to run these workflows? (Each correct answer presents part of the solution. Choose two.)
Configure the webhook and network to enable GitHub to trigger workflow.
Create the group custom-software-on-linux and move the runner into the group.
Inform users to identify the runner with the labels custom-software and linux.
Add the label linux to the runner.
Inform users to identify the runner based on the group.