[Apr 04, 2026] Download Free Microsoft GH-200 Real Exam Questions [Q50-Q72]

Share

[Apr 04, 2026] Download Free Microsoft GH-200 Real Exam Questions

Pass Your Exam With 100% Verified GH-200 Exam Questions

NEW QUESTION # 50
Which of the following is the proper syntax to specify a custom environment variable named MY_VARIABLE with the value my-value?

  • A. var:
    MY_VARIABLE = my-value
  • B. var:
    MY_VARIABLE: my-value
  • C. env:
    MY_VARIABLE: my-value
  • D. environment:
    MY_VARIABLE = my-value
  • E. environment:
    MY_VARIABLE: my-value
  • F. env:
    MY_VARIABLE = my-value

Answer: C

Explanation:
To set a custom environment variable for a single workflow, you can define it using the env key in the workflow file.
Example:
env:
DAY_OF_WEEK: Monday
Note: The scope of a custom variable set by this method is limited to the element in which it is defined. You can define variables that are scoped for:
The entire workflow, by using env at the top level of the workflow file.
The contents of a job within a workflow, by using jobs.<job_id>.env.
A specific step within a job, by using jobs.<job_id>.steps[*].env.
Reference:
https://docs.github.com/en/actions/how-tos/write-workflows/choose-what-workflows-do/use- variables


NEW QUESTION # 51
Which workflow commands send information from the runner? (Each correct answer presents a complete solution. Choose two.)

  • A. reading from environment variables
  • B. setting output parameters
  • C. populating variables in a Dockerfile
  • D. setting a debug message

Answer: B,D

Explanation:
[B] Setting a debug message
Prints a debug message to the log. You must create a secret named ACTIONS_STEP_DEBUG with the value true to see the debug messages set by this command in the log.
::debug::{message}
Example: Setting a debug message
echo "::debug::Set the Octocat variable"
[D] Setting an output parameter
Sets a step's output parameter. Note that the step will need an id to be defined to later retrieve the output value.
echo "{name}={value}" >> "$GITHUB_OUTPUT"
Example of setting an output parameter
This example demonstrates how to set the SELECTED_COLOR output parameter and later retrieve it:
- name: Set color
id: color-selector
run: echo "SELECTED_COLOR=green" >> "$GITHUB_OUTPUT"
- name: Get color
env:
SELECTED_COLOR: ${{ steps.color-selector.outputs.SELECTED_COLOR }}
run: echo "The selected color is $SELECTED_COLOR"
Reference:
https://docs.github.com/en/actions/reference/workflows-and-actions/workflow-commands


NEW QUESTION # 52
Which of the following scenarios would require the use of self-hosted runners instead of GitHub-hosted runners?

  • A. performing builds on macOS
  • B. using Docker containers as part of the workflow
  • C. running more than the three concurrent workflows supported by GitHub-hosted runners
  • D. using specialized hardware configurations required for workflows
  • E. exceeding 50,000 monthly minutes of build time

Answer: C,D

Explanation:
GitHub-hosted runners have a limit on the number of concurrent workflows (typically 20 for free-tier accounts and 5 for enterprise). If your organization needs to run more workflows simultaneously, you would need to use self-hosted runners to increase the available concurrency.
Self-hosted runners allow you to configure specialized hardware or software setups that are necessary for certain workflows. GitHub-hosted runners may not have access to custom hardware configurations like GPUs or other specialized resources, so self-hosted runners are required in such cases.


NEW QUESTION # 53
Which of the following is a valid reusable workflow reference?

  • A. uses: octo-org/another-repo/.github/workflows/workflow.yml@v1
  • B. uses: another-repo/workflow.yml@v1
  • C. uses: another-repo/.github/workflows/workflow.yml@v1
  • D. uses: octo-org/another-repo/workflow.yml@v1

Answer: A

Explanation:
Calling a reusable workflow
You call a reusable workflow by using the uses keyword. Unlike when you are using actions within a workflow, you call reusable workflows directly within a job, and not from within job steps.
jobs.<job_id>.uses
You reference reusable workflow files using one of the following syntaxes:
*-> {owner}/{repo}/.github/workflows/{filename}@{ref} for reusable workflows in public and private repositories.
* ./.github/workflows/{filename} for reusable workflows in the same repository.
Reference:
https://docs.github.com/en/actions/how-tos/reuse-automations/reuse-workflows


NEW QUESTION # 54
In the following workflow file, line 5 interprets lines 3 and 4 as Python. Which of the following is a valid option to complete line 5?
1 steps:
2 - run: |
3 import os
4 print(os.environ['PATH'])
5

  • A. with: python
  • B. working-directory: .github/python
  • C. shell: python
  • D. shell: bash

Answer: C

Explanation:
Workflow syntax for GitHub Actions
Example: Running an inline Python script
steps:
- name: Display the path
shell: python
run: |
import os
print(os.environ['PATH'])
Reference:
https://docs.github.com/en/actions/reference/workflows-and-actions/workflow-syntax


NEW QUESTION # 55
As a developer, which workflow steps should you perform to publish an image to the GitHub Container Registry? (Each correct answer represents part of the solution. Choose three).

  • A. Authenticate to the GitHub Container Registry.
  • B. Use the actions/setup-docker action.
  • C. Push the image to the GitHub Container Registry.
  • D. Pull the image from the GitHub Container Registry.
  • E. Build the container image.

Answer: A,C,E

Explanation:
Publishing Docker images
The below workflow checks out the GitHub repository, uses the login-action to log in to the registry [B], and then uses the build-push-action action to: build a Docker image based on your repository's Dockerfile [E]; push the image to Docker Hub [A], and apply a tag to the image.
Note:
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
# GitHub recommends pinning actions to a commit SHA.
# To get a newer version, you will need to update the SHA.
# You can also reference a tag or branch, but the action may change without warning.
Reference:
https://docs.github.com/en/actions/tutorials/publish-packages/publish-docker-images


NEW QUESTION # 56
In which scenarios could the GITHUB_TOKEN be used? (Choose two.)

  • A. to leverage a self-hosted runner
  • B. to read from the file system on the runner
  • C. to publish to GitHub Packages
  • D. to add a member to an organization
  • E. to create a repository secret
  • F. to create issues in the repo

Answer: C,F

Explanation:
The GITHUB_TOKEN is automatically provided by GitHub in workflows and can be used to authenticate API requests to GitHub, including publishing packages to GitHub Packages.
The GITHUB_TOKEN is also used to authenticate API requests for actions like creating issues, commenting, or interacting with pull requests within the same repository.


NEW QUESTION # 57
Which of the following statements are true regarding the use of GitHub Actions on a GitHub Enterprise Server instance? (Each correct answer presents a complete solution. Choose three.)

  • A. Third-party actions can be manually synchronized for use on GitHub Enterprise Server.
  • B. Third-party actions can be used on GitHub Enterprise Server by configuring GitHub Connect.
  • C. Use of GitHub Actions on GitHub Enterprise Server requires a persistent internet connection.
  • D. Most GitHub-authored actions are automatically bundled for use on GitHub Enterprise Server.
  • E. Actions must be defined in the .github repository.
  • F. Actions created by GitHub are automatically available and cannot be disabled.

Answer: A,B,D

Explanation:
[B] If you want your GitHub Enterprise Server instance to use third-party custom actions, you need to enable GitHub Connect.
[C] Most official GitHub-authored actions are automatically bundled with GitHub Enterprise Server, and are captured at a point in time from GitHub Marketplace.
[F] Third-party actions can be manually synchronized to GitHub Enterprise Server (GHES) to be used in workflows without requiring an internet connection to GitHub.com. This is done using the actions-sync tool to download actions from GitHub.com and transfer them to the GHES instance.
This manual method provides an alternative to using GitHub Connect, offering stricter control over which actions are available on the GHES instance.
Reference:
https://docs.github.com/en/[email protected]/get-started/exploring-integrations/about- using-integrations
https://docs.github.com/en/[email protected]/admin/managing-github-actions-for-your- enterprise/managing-access-to-actions-from-githubcom/about-using-actions-in-your-enterprise


NEW QUESTION # 58
Which syntax correctly accesses a job output (output1) of an upstream job (job1) from a dependent job within a workflow?

  • A. ${{needs.job1.output1}}
  • B. ${{needs.job1.outputs.output1}}
  • C. ${{job1.outputs.output1}}
  • D. ${{depends.job1.output1}}

Answer: B

Explanation:
To access the outputs in the dependent job, use the needs.<job_id>.outputs.<output_name> syntax. For example, the following job accesses the output1 and output2 outputs defined in job1:
jobs:
# Assume job1 is defined as above
job2:
runs-on: ubuntu-latest
needs: job1
steps:
- env:
OUTPUT1: ${{needs.job1.outputs.output1}}
OUTPUT2: ${{needs.job1.outputs.output2}}
run: echo "$OUTPUT1 $OUTPUT2"
Reference:
https://docs.github.com/en/actions/how-tos/write-workflows/choose-what-workflows-do/pass-job- outputs


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

  • A. Use a branch name.
  • B. Use a commit hash.
  • C. Use a major release tag.
  • D. Use a patch release tag.

Answer: B

Explanation:
Using a commit hash is the safest method because it references a specific point in time in the repository's history. This ensures that the action is locked to that exact version and will not be affected by any future changes or modifications to the codebase. Even if the action is updated later, your workflow will continue using the specific commit you referenced.


NEW QUESTION # 60
Which of the following scenarios requires a developer to explicitly use the GITHUB_TOKEN or github.token secret within a workflow? (Choose two.)

  • A. assigning non-default permissions to the GITHUB_TOKEN
  • B. checking out source code with the actions/checkout@v3 action
  • C. passing the GITHUB_TOKEN secret to an action that requires a token as an input
  • D. making an authenticated GitHub API request

Answer: C,D

Explanation:
[A] Some actions may require a GITHUB_TOKEN as an input to authenticate and perform specific tasks, such as creating issues, commenting on pull requests, or interacting with the GitHub API. In such cases, you would need to explicitly pass the token to the action.
[B] When making an authenticated GitHub API request, the GITHUB_TOKEN is required to authenticate the request. This token is automatically provided by GitHub in the workflow, and it must be explicitly used when interacting with the GitHub API.
Note: You can use the GITHUB_TOKEN to make authenticated API calls. This example workflow creates an issue using the GitHub REST API:
Reference:
https://docs.github.com/en/actions/tutorials/authenticate-with-github_token


NEW QUESTION # 61
You are a developer, and your container jobs are failing on a self-hosted runner. Which requirements must you check to ensure that the self-hosted runner is properly configured? (Choose two.)

  • A. Docker is installed on the self-hosted runner.
  • B. The service status of Kubernetes is "active".
  • C. The self-hosted runner is running a Linux operating system.
  • D. Kubernetes is installed on the self-hosted runner.
  • E. The self-hosted runner is running a Windows operating system.

Answer: A,C

Explanation:
While Docker can run on various operating systems, Linux is often the most common and preferred OS for containerized workloads. Docker works well on Linux and is a widely-used platform for running containers.
For container jobs to run on a self-hosted runner, Docker must be installed and properly configured on the runner. Docker is required to build and run containerized workloads in a GitHub Actions workflow.


NEW QUESTION # 62
You need to make a script to retrieve workflow run logs via the API. Which is the correct API to download a workflow run log?

  • A. POST /repos/:owner/:repo/actions/runs/:run_id/logs
  • B. GET /repos/:owner/:repo/actions/runs/:run_id/logs
  • C. GET /repos/:owner/:repo/actions/artifacts/logs
  • D. POST /repos/:owner/:repo/actions/runs/:run_id

Answer: B

Explanation:
The GET /repos/:owner/:repo/actions/runs/:run_id/logs API endpoint is used to retrieve the logs of a specific workflow run identified by run_id. This is the correct method for downloading logs from a workflow run.


NEW QUESTION # 63
In which locations can actions be referenced by workflows? (Choose three.)

  • A. the repository's Secrets settings page
  • B. a public NPM registry
  • C. the runs-on: keyword of a workflow file
  • D. an .action extension file in the repository
  • E. a separate public repository
  • F. a published Docker container image on Docker Hub
  • G. the same repository as the workflow

Answer: E,F,G

Explanation:
Actions can be stored in a separate public repository and referenced in workflows by specifying the repository and action name.
Actions can also be stored in the same repository as the workflow and referenced directly by their path (e.g., ./.github/actions/my-action).
Actions can be packaged as Docker container images and published to Docker Hub. These can then be referenced in workflows by specifying the Docker image.


NEW QUESTION # 64
GitHub-hosted runners support which capabilities? (Choose two.)

  • A. automatic file-system caching between workflow runs
  • B. support for Linux, Windows, and mac
  • C. support for a variety of Linux variations including CentOS, Fedora, and Debian
  • D. requiring a payment mechanism (e.g., credit card) to use for private repositories
  • E. automatic patching of both the runner and the underlying OS

Answer: B,C

Explanation:
GitHub-hosted runners automatically handle patching, meaning they will be kept up to date with the latest security updates and software patches for both the runner environment and the underlying operating system.
GitHub-hosted runners support Linux, Windows, and macOS, giving you flexibility to run workflows on different operating systems without needing to manage your own self-hosted runners.


NEW QUESTION # 65
As a developer, you are using a Docker container action in your workflow. What is required for the action to run successfully?

  • A. The job runs-on must specify a Linux machine with Docker installed.
  • B. The action must be published to the GitHub Marketplace.
  • C. The job env must be set to a Linux environment.
  • D. The referenced action must be hosted on Docker Hub.

Answer: A

Explanation:
For a Docker container action to run in a GitHub Actions workflow, the runner must have Docker installed. The runs-on attribute of the job should specify an environment that supports Docker, typically a Linux environment (e.g., ubuntu-latest), since Docker is widely supported and commonly used in Linux-based environments.


NEW QUESTION # 66
What are two reasons to keep an action in its own repository instead of bundling it with other application code? (Each correct answer presents a complete solution. Choose two.)

  • A. It makes it easier for the GitHub community to discover the action.
  • B. It widens the scope of the code base for developers fixing issues and extending the action.
  • C. It makes the action.yml file optional.
  • D. It decouples the action's versioning from the versioning of other application code.
  • E. It allows sharing workflow secrets with other users.

Answer: A,D

Explanation:
Storing an action in its own repository makes it easier for the GitHub community to discover the action [B], narrows the scope [Not C] of the code base for developers fixing issues and extending the action, and decouples the action's versioning from the versioning of other application code
[D].
Reference:
https://docs.github.com/en/actions/how-tos/create-and-publish-actions/manage-custom-actions


NEW QUESTION # 67
As a developer, your Actions workflow often reuses the same outputs or downloaded dependencies from one run to another. To cache dependencies for a job, you are using the GitHub cache action. Which input parameters are required for this action? (Each correct answer presents part of the solution. Choose two.)

  • A. cache-hit: the copy action key used with restore parameter to restore the data from the cache
  • B. dependency: the name and version of a package to cache or restore
  • C. path: the file path on the runner to cache or restore
  • D. key: the key created when saving a cache and the key used to search for a cache
  • E. ref: the ref name of the branch to access and restore a cache created
  • F. restore-keys: the copy action key used with cache parameter to cache the data

Answer: C,D

Explanation:
Input parameters for the cache action
[C] key: Required The key created when saving a cache and the key used to search for a cache.
It can be any combination of variables, context values, static strings, and functions. Keys have a maximum length of 512 characters, and keys longer than the maximum length will cause the action to fail.
[A] path: Required The path(s) on the runner to cache or restore.
Reference:
https://docs.github.com/en/actions/reference/workflows-and-actions/dependency-caching


NEW QUESTION # 68
As a developer, you are configuring GitHub Actions to deploy VMs to production. A member of the VMOps team must provide approval before the deployment occurs. Which of the following steps should you take? (Each correct answer presents part of the solution. Choose two.)

  • A. Navigate to the organization settings and create a Production environment with the VMOps team as a required reviewer.
  • B. Navigate to the repository settings and create a Production environment with the VMOps team as a required reviewer.
  • C. Specify the environment named Production in the workflow jobs that deploy to the VMs.
  • D. Specify the VMOps team as the owner of the environment.
  • E. Add the VMs to the environment.

Answer: B

Explanation:
Creating an environment
To configure an environment in a personal account repository, you must be the repository owner.
To configure an environment in an organization repository, you must have admin access.
On GitHub, navigate to the main page of the repository.
Under your repository name, click Settings. ...
In the left sidebar, click Environments.
Click New environment.
Enter a name for the environment, then click Configure environment.
Etc.
Reference:
https://docs.github.com/en/actions/how-tos/deploy/configure-and-manage-deployments/manage- environments


NEW QUESTION # 69
Which run: command will set a step's output?

  • A. run: export MY_OUTPUT=foo
  • B. run: echo "MY_OUTPUT=foo" >> $GITHUB_OUTPUT
  • C. run: echo ${{ $GITHUB_OUTPUT=foo }}
  • D. run: echo "::set-env name=MY OUTPUT::foo"

Answer: B

Explanation:
The $GITHUB_OUTPUT file is used to pass data from one step to another in GitHub Actions. The echo command appends the key-value pair to this file, which sets the output variable (MY_OUTPUT) for the current step.


NEW QUESTION # 70
As a DevOps engineer, you need to define a deployment workflow that runs after the build workflow has successfully completed. Without modifying the build workflow, which trigger should you define in the deployment workflow?

  • A. workflow_dispatch
  • B. workflow_exec
  • C. repository_dispatch
  • D. workflow_run

Answer: D

Explanation:
A deployment workflow can be started after a build workflow has finished by using the workflow_run event in the deployment workflow's on trigger. You must specify the name of the build workflow you want to trigger on and use an if condition to ensure the deployment workflow only runs if the build workflow successfully completes.
Here's how to set it up:
In your deployment workflow file: (e.g., deploy.yml), define the on: trigger.
Use the workflow_run event: within the on: trigger.
Specify the build workflow: by its name.
Add a conditional if statement: to the workflow to check the conclusion of the workflow_run event, ensuring it equals 'success'.
Reference:
https://docs.github.com/actions/learn-github-actions/events-that-trigger-workflows


NEW QUESTION # 71
How should you print a debug message in your workflow?

  • A. echo "::debug::Set variable myVariable to true"
  • B. echo "Set variable MyVariable to true" >> $DEBUG_MESSAGE
  • C. echo "::add-mask::Set variable myVariable to true"
  • D. echo "debug_message=Set variable myVariable to true" >> &GITHUB_OUTPUT

Answer: 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


NEW QUESTION # 72
......


Microsoft GH-200 Exam Syllabus Topics:

TopicDetails
Topic 1
  • Author and Maintain Actions: This domain evaluates the abilities of Action Developers and Automation Engineers to select and create suitable types of GitHub Actions, such as JavaScript, Docker containers, or run steps. It emphasizes troubleshooting action code, understanding the components and file structures of actions, and using workflow commands within actions to communicate with runners, including exit code management.
Topic 2
  • Manage GitHub Actions in the Enterprise: This section measures the expertise of Enterprise Administrators and Platform Engineers in distributing and managing GitHub Actions and workflows at the organizational level. It includes reuse and sharing of templates, strategies for managing reusable components via repositories and naming conventions, controlling access to actions, setting organization-wide usage policies, and planning maintenance to ensure efficient enterprise-wide deployment of GitHub Actions.
Topic 3
  • Consume Workflows: This domain targets Software Developers and Quality Assurance Engineers and focuses on interpreting workflow runs and their outcomes. It covers identifying triggering events, reading workflow configurations, troubleshooting failures by analyzing logs, enabling debug logging, managing environment variables, caching dependencies, and passing data between jobs. Candidates also manage workflow runs, artifacts, approvals, and status badges, as well as locating workflows within repositories and leveraging organizational templated workflows.
Topic 4
  • Author and Maintain Workflows: This section of the exam measures skills of DevOps Engineers and Automation Specialists and covers building and managing workflows triggered by events such as pushes, scheduled times, manual triggers, and webhooks. It includes understanding workflow components like jobs, steps, actions, and runners, syntax correctness, environment variables, secrets management, and dependencies between jobs. Candidates will also demonstrate practical abilities to create workflows for various purposes, including publishing packages, using service containers, routing jobs, and deploying releases to cloud providers.

 

GH-200 Dumps 100 Pass Guarantee With Latest Demo: https://www.examtorrent.com/GH-200-valid-vce-dumps.html

GH-200 Dumps PDF - GH-200 Real Exam Questions Answers: https://drive.google.com/open?id=17ylMac09qr_BnyuNEssms5nitctdaiuM