Microsoft GH-200 GitHub Actions Exam Exam Practice Test
GitHub Actions Exam Questions and Answers
As a DevOps engineer, you are developing a composite action. You have a step that needs to be executed against a subdirectory. Which code snippet should you use within the composite action to specify the directory?
As a developer, you are using a Docker container action in your workflow. What is required for the action to run successfully?
Which workflow commands send information from the runner? (Choose two.)
When should you use the GITHUB_TOKEN in a workflow?
What is the simplest action type to run a shell script?
What are the two types of environment protection rules you can configure? (Choose two.)
What are the advantages of using a matrix strategy in a job definition? (Choose two.)
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.)
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.
Without the need to use additional infrastructure, what is the simplest and most maintainable method for configuring a workflow job to provide access to an empty PostgreSQL database?
Based on the YAML below, which two statements are correct? (Choose two.)
As a DevOps engineer, you are trying to leverage an organization secret in a repo. The value received in the workflow is not the same as that set in the secret. What is the most likely reason for the difference?
Which files are required for a Docker container action in addition to the source code? (Choose two.)
Which command can you include in your workflow file to set the output parameter for an action?
When reviewing an action for use, what file defines its available inputs and outputs?
Which default GitHub environment variable indicates the name of the person or app that initiated a workflow?
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? (Choose two.)
Your organization needs to simplify reusing and maintaining automation in your GitHub Enterprise Cloud. Which components can be directly reused across all repositories in an organization? (Choose three.)
A development team has been using a Powershell script to compile and package their solution using existing tools on a Linux VM, which has been configured as a self-hosted runner. They would like to use the script as-is in an automated workflow. Which of the following should they do to invoke their script within a workflow step?
Which default environment variable specifies the branch or tag that triggered a workflow?
Your organization is managing secrets using GitHub encrypted secrets, including a secret named SuperSecret. As a developer, you need to create a version of that secret that contains a different value for use in a workflow that is scoped to a specific repository named MyRepo. How should you store the secret to access your specific version within your workflow?
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.)
As a DevOps engineer, you are developing workflows to build an application. You have a requirement to create the build targeting multiple node versions. Which code block should you use to define the workflow?
You need to perform a task that requires running a custom script in a GitHub Actions workflow. The script must run within the workflow environment without requiring an external container or prebuilt image.
What should you use?
In which scenarios could the GITHUB_TOKEN be used? (Choose two.)
As a developer, what options should you recommend to implement standards for automation reuse? (Choose two.)
As a developer, you need to create a custom action written in Python. Which action type should you choose?
As a developer, you need to create a custom action written in Python. Which action type should you choose?
You need to create a reusable GitHub Actions workflow template named ci.yml. The solution must ensure that ci.yml appears on the New workflow interface of GitHub Actions. Where should you store ci.yml?
Which workflow command would output the debug message " action successfully debugged " ?
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?
What is the minimal syntax for declaring an output named foo for an action?
A)
B)
C)
D)
You have a GitHub repository named Repo1. Repo1 uses GitHub Actions workflows that upload build artifacts
You plan to change the artifact and log retention period to 30 days.
You need to remove expired GitHub Actions artifacts from Report. The solution must explicitly identify and delete existing expired artifacts by using the REST API.
How should you complete the script? To answer, select the appropriate options in the answer area.
NOTE: Each correct selection is worth one point.

You are a developer working on developing reusable workflows for your organization. What keyword should be included as part of the reusable workflow event triggers?
Which step is using the dbserver environment variable correctly?
You create a self-hosted runner labeled as runner1.
You need to ensure that a GitHub Actions workflow job runs only on runner1.
Which YAML statement should you use?
As a DevOps engineer, you need to execute a deployment to different environments such as development and testing based on labels added to a pull request. The deployment should use the releases branch and trigger only when there is a change in files under the apps folder. Which code block should be used to define the deployment workflow trigger?
As a developer, you need to use GitHub Actions to deploy a microservice that requires runtime access to a secure token. This token is used by a variety of other microservices managed by different teams in different repos. To minimize management overhead and ensure the token is secure, which mechanisms should you use to store and access the token? (Choose two.)
You need to stop a GitHub Actions workflow from running. The solution must retain the configuration and execution history of the workflow.
What should you do?
How should you install the bats NPM package in your workflow?
A)
B)
C)
D)
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?
What is the proper syntax to reference the system-provided run number variable?
What is the most suitable action type for a custom action written in TypeScript?
As a DevOps engineer, you are developing a composite action. You have a step that needs to be executed against a subdirectory. Which code snippet should you use within the composite action to specify the directory?
As a developer, you need to create a custom action written in Python. Which action type should you choose?
What menu options in a repository do you need to select in order to use a starter workflow that is provided by your organization?

