Free GH-200 Exam Braindumps
GitHub Actions Questions 1–5 (page: 2)

Updated On: 16-Nov-2026

How should you print a debug message in your workflow?

  1. echo "::debug::Set variable myVariable to true"
  2. echo "Set variable MyVariable to true" >> $DEBUG_MESSAGE
  3. echo "::add-mask::Set variable myVariable to true"
  4. echo "debug_message=Set variable myVariable to true" >> &GITHUB_OUTPUT

Answer(s): A

Explanation:

Example: Setting a debug message echo "::debug::Set the Octocat variable"


Reference:

https://docs.github.com/en/actions/reference/workflows-and-actions/workflow-commands



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?

  1. composite run step
  2. enable debug logging
  3. self-hosted runners
  4. environment variables
  5. workflow commands

Answer(s): E

Explanation:

Workflow commands for GitHub Actions
You can use workflow commands when running shell commands in a workflow or in an action's code.
About workflow commands
Actions can 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.
Most workflow commands use the echo command in a specific format, while others are invoked by writing to a file.


Reference:

https://docs.github.com/en/actions/reference/workflows-and-actions/workflow-commands



When should you use the GITHUB_TOKEN in a workflow?

  1. when you want to make authenticated calls to the GitHub API
  2. when you want to connect to the runner via SSH
  3. when you want to access repository-level secrets
  4. when you want to call an action from the marketplace

Answer(s): A

Explanation:

Use GITHUB_TOKEN for authentication in workflows
At the start of each workflow job, GitHub automatically creates a unique GITHUB_TOKEN secret to use in your workflow. You can use the GITHUB_TOKEN to authenticate in the workflow job.


Reference:

https://docs.github.com/en/actions/tutorials/authenticate-with-github_token



In which of the following scenarios should you use self-hosted runners? (Each correct answer presents a complete solution. Choose two.)

  1. when the workflow jobs must be run on Windows 10
  2. when jobs must run for longer than 6 hours
  3. when a workflow job needs to install software from the local network
  4. when GitHub Actions minutes must be used for the workflow runs
  5. when you want to use macOS runners

Answer(s): B,C

Explanation:

[B] You can use self-hosted runner to run more than 6 hours job.
Self-hosted runners give you the opportunity to persist whatever you like for your jobs and not be subject to the six-hour time-out in hosted virtual environments.
[C] Give you more control of hardware, operating system, and software tools than GitHub-hosted runners provide.
All runners can run Linux, Windows, or macOS.
Incorrect:
[Not A, not E]
GitHub-hosted runners are fully managed on GitHub’s infrastructure using pre-configured Windows, Linux, and macOS virtual machines. In addition to offering standard runners for typical workloads, hosted runners offer larger runners with more resources (memory, CPU, and storage), custom images, static IP ranges, and Azure Virtual Network integration for enhanced security control.
[Not D]
GitHub Actions minutes refer to the amount of time your workflows, such as CI/CD pipelines, run on GitHub's hosted runners. Each time you trigger GitHub Actions (e.g., for testing, building, or deploying code), it consumes a portion of your available minutes.5 Dec 2024


Reference:

https://github.com/orgs/community/discussions/26679
https://docs.github.com/en/enterprise-cloud@latest/admin/managing-github-actions-for-your-enterprise/getting-started-with-github-actions-for-your-enterprise/getting-started-with-self-hosted-runners-for-your-enterprise https://docs.github.com/en/enterprise-cloud@latest/actions/concepts/runners/self-hosted-runners



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?

  1. Install Redis on the hosted runner image and place it in a runner group. Specify label: in your job to target the runner group.
  2. Set up Redis on a separate machine and reference that instance from your job.
  3. Specify container: and services: in your job definition to leverage a Redis service container.
  4. Add a run step to your workflow, which dynamically installs and configures Redis as part of your job.

Answer(s): C

Explanation:

Creating Redis service containers
You can use service containers to create a Redis client in your workflow. You can create a Redis service for jobs that run in containers or directly on the runner machine.
Configuring the runner job
The example uses the ubuntu-latest GitHub-hosted runner as the Docker host.
The workflow configures a service container with the label redis.
jobs:
# Label of the runner job runner-job:
# You must use a Linux environment when using service containers or container jobs runs-on: ubuntu-latest
# Service containers to run with `runner-job`
services:
# Label used to access the service container redis:
# Docker Hub image image: redis
# Set health checks to wait until redis has started options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
# Maps port 6379 on service container to the host
- 6379:6379


Reference:

https://docs.github.com/en/actions/tutorials/use-containerized-services/create-redis-service-containers



Viewing page 2 of 28
Viewing questions 6 - 10 out of 134 questions


Post your Comments and Discuss Microsoft GH-200 exam prep with other Community members:

AI Tutor AI Tutor 👋 I’m here to help!