Limited-Time Offer: Enjoy 50% Savings! Ends in 00h 00m 00s Coupon code: 50OFF
Skip to content

Free Microsoft GitHub Actions Exam GH-200 Exam Questions

Page: 1 / 14 Total 137 questions

Want more questions? Get Premium Access.

Question 1

As a developer, you are authoring a workflow that will deploy to both DevCloud and TestCloud resources. Each cloud resource is accessed with a different deployment key. Which approach best allows you to use the same reusable workflow in separate jobs to target the different cloud resources?

Correct Answer: B. Store the different keys in a DEPLOY_KEY environment secret in the DevCloud and TestCloud environments. Specify DEPLOY_KEY in the secrets section of the reusable workflow.
Explanation:

The best design is to use environment-scoped secrets with the same secret name, such as DEPLOY_KEY, in separate environments such as DevCloud and TestCloud. This lets the same reusable deployment logic reference one consistent secret name while the selected environment supplies the correct value. Option A is invalid because GitHub secret names should not be designed around dotted property access, and reusable workflows should not parse secret names dynamically. Option C introduces unnecessary marketplace dependency and weak secret handling. Option D is also wrong because GitHub secrets are opaque strings; ${{ secrets.DEPLOY_KEY.DevCloud }} is not valid secret property access. Reusable workflows can define and receive named secrets through the secrets mapping.


Question 2

As a developer, your self-hosted runner sometimes looses connection while running jobs. How should you troubleshoot the issue affecting your self-hosted runner?

Correct Answer: C. Access the self-hosted runner's installation directory and look for log files in the _diag folder.
Explanation:

When troubleshooting a self-hosted runner, you can access the _diag folder located in the self-hosted runner's installation directory. This folder contains diagnostic logs that can help you identify the root cause of issues, such as connection problems.


Question 3

GitHub-hosted runners support which capabilities? (Choose two.)

Correct Answer: C. support for Linux, Windows, and mac; D. support for a variety of Linux variations including CentOS, Fedora, and Debian
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.


Question 4

As a developer, you want to review the step that caused a workflow failure and the failed step's build logs. First navigate to the main page of the repository on GitHub. Which section contains the step failure information?

Correct Answer: C. Actions
Explanation:

The Actions tab on the main page of the repository is where you can find detailed information about the workflow runs, including step failures and build logs. You can review the status of each job and step within the workflow, see the failure messages, and access logs for debugging.


Question 5

Which default environment variable specifies the branch or tag that triggered a workflow?

Correct Answer: B. GITHUB_REF
Explanation:

The GITHUB_REF environment variable specifies the branch or tag that triggered the workflow. It contains the full reference to the branch or tag, such as refs/heads/main for a branch or refs/tags/v1.0 for a tag.


Question 6

As a developer, you need to integrate a GitHub Actions workflow with a third-party code quality provider that uses the Checks API. How should you trigger a follow-up workflow?

Correct Answer: B. Add the check_run webhook event as a trigger for the workflow when the code quality integration is completed
Explanation:

The check_run event is triggered when a check (such as a code quality check) completes, including when the status of a check changes. By adding this event as a trigger, you can initiate a follow-up workflow when the code quality integration finishes its checks.


Question 7

Disabling a workflow allows you to stop a workflow from being triggered without having to delete the file from the repo. In which scenarios would temporarily disabling a workflow be most useful? (Choose two.)

Correct Answer: A. A workflow sends requests to a service that is down.; B. A workflow error produces too many, or wrong, requests, impacting external services negatively.
Explanation:

If a workflow depends on an external service that is down, disabling the workflow temporarily will prevent it from running and sending requests to the service, thus avoiding failed requests or unnecessary retries.

If a workflow is causing a negative impact on external services by generating too many requests or incorrect data due to a bug, temporarily disabling the workflow will stop this behavior while the issue is fixed.


Question 8

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

Correct Answer: A. Use artifact storage.
Explanation:

The correct native GitHub Actions method for passing files between jobs in the same workflow is artifact storage. Workflow artifacts are designed to persist files produced by one job so they can be downloaded and used by another job later in the workflow. Job outputs are better suited for passing small values, strings, IDs, flags, or metadata between jobs, not full files. Caching is intended to speed up repeated workflow runs by reusing dependencies or build outputs; it is not the proper mechanism for transferring job-produced files. An external blob store can work architecturally, but it is not the native GitHub Actions method. Therefore, artifact storage is the best and most exam-aligned answer for passing files between jobs.


Question 9

Which of the following is the best way for an enterprise to prevent certain marketplace actions from running?

Correct Answer: D. Create a list of the actions that are allowed to run as an enterprise policy. Only these actions can be run.
Explanation:

The best way for an enterprise to control which GitHub Actions run is by creating a list of approved actions as an enterprise policy. This approach restricts workflows to only use the actions that are explicitly allowed, ensuring security and compliance within the organization.


Question 10

As a DevOps engineer, you need to execute a deployment to different environments like development and testing based on the labels added to a pull request. The deployment should use the releases branch and trigger only when there is a change in the files under apps folder. Which code block should be used to define the deployment workflow trigger?

Correct Answer: D. on:pull_request:types: [labeled]branches:- 'releases'paths:- 'apps/**'
Explanation:

The correct trigger must use the pull_request event because the workflow is based on activity on a pull request. The specific activity is a label being added, so types: [labeled] is required. The deployment must target the releases branch, so the branch filter must be branches: - 'releases'. The workflow must also run only when files under the apps folder change, so paths: - 'apps/**' is the correct recursive path filter. Option A is invalid because pull_request_label is not a GitHub Actions event. Option B uses the wrong event, pull_request_review. Option C uses an incorrect branch/path combination. GitHub workflow syntax supports event activity types, branch filters, and path filters together.