
Provide Microsoft GH-200 Practice Test Engine for Preparation
Detailed New GH-200 Exam Questions for Concept Clearance
NEW QUESTION # 10
What are the most significant advantages of adding documentation while distributing custom actions? (Each answer presents a complete solution. Choose two.)
- A. It provides an example of the action.
- B. It generates auto completion when using the action in a workflow.
- C. It shares the description of the action to the users.
- D. It creates a readme.md for the consuming workflow.
Answer: C,D
NEW QUESTION # 11
Which of the following is the lowest repository permission you need to have for downloading workflow artifacts?
- A. Triage
- B. Maintain
- C. Admin
- D. Write
- E. Read
Answer: E
Explanation:
Downloading workflow artifacts
You can download archived artifacts before they automatically expire.
Who can use this feature?
People who are signed into GitHub and have read access to a repository can download workflow artifacts.
Reference:
https://docs.github.com/en/actions/how-tos/manage-workflow-runs/download-workflow-artifacts
NEW QUESTION # 12
What is the right method to ensure users approve a workflow before the next step proceeds?
- A. adding users as required reviewers for an environment
- B. granting users repository approval permissions
- C. granting users workflow approval permissions
- D. creating a branch protection rule and only allow certain users access
Answer: A
Explanation:
GitHub Actions allows you to configure environment protection rules, where you can require specific users or teams to approve the deployment before the workflow proceeds to the next step. This ensures that the required reviewers approve the workflow before any sensitive actions (such as deployment) occur.
NEW QUESTION # 13
In GitHub Enterprise Cloud, where do you set the policy that allows only enterprise hosted actions and reusable workflows to run?
- A. Organization settings Policies then Actions
- B. Enterprise account Actions policy
- C. Repository settings Actions general
Answer: B
Explanation:
The enterprise Actions policy is the centralized place where enterprise owners enforce which actions and reusable workflows are permitted across all organizations in GitHub Enterprise Cloud. From this scope you can require that only actions and reusable workflows hosted within the enterprise are allowed to run, and this policy flows down to organizations and repositories to ensure consistent enforcement.
NEW QUESTION # 14
As a developer, how can you identify a composite action on GitHub?
- A. The action's repository includes Dockerfile and package.json files.
- B. The action.yml metadata file has the runs.using value set to composite.
- C. The action's repository name includes the keyword "composite."
- D. The action's repository includes an init.sh file in the root directory.
Answer: B
Explanation:
runs.using for composite actions
Required: You must set this value to 'composite'.
Reference:
https://docs.github.com/en/actions/reference/workflows-and-actions/metadata-syntax
NEW QUESTION # 15
Which action type should be used to bundle a series of run steps into a reusable custom action?
- A. Docker container action
- B. Bash script action
- C. Composite action
- D. JavaScript action
Answer: C
Explanation:
Reusable workflows versus composite actions
Reusable workflows and composite actions both help you avoid duplicating workflow content.
Whereas reusable workflows allow you to reuse an entire workflow, with multiple jobs and steps, composite actions combine multiple steps that you can then run within a job step, just like any other action.
A composite action allows you to bundle multiple steps into a single reusable action within a workflow. It is composed of multiple run steps or other actions and can be reused across workflows, making it the perfect choice for bundling a series of steps.
Reference:
https://docs.github.com/en/actions/concepts/workflows-and-actions/reusable-workflows
NEW QUESTION # 16
You need to create new workflows to deploy to an unfamiliar cloud provider. What is the fastest and safest way to begin?
- A. Search GitHub Marketplace for verified actions published by the cloud provider.
- B. Search GitHub Marketplace for actions created by GitHub.
- C. Create a custom action to wrap the cloud provider's CLI.
- D. Use the actions/jenkins-plugin action to utilize an existing Jenkins plugin for the cloud provider.
- E. Download the CLI for the cloud provider and review the associated documentation.
Answer: A
Explanation:
Searching the GitHub Marketplace for verified actions published by the cloud provider is the quickest and safest approach. Many cloud providers offer verified GitHub Actions that are maintained and optimized to interact with their services. These actions typically come with the correct configurations and best practices, allowing you to get started quickly without reinventing the wheel.
Note: About GitHub Marketplace for apps
GitHub Marketplace where you can share your apps with everyone.
GitHub Marketplace connects you to developers who want to extend and improve their GitHub workflows. You can list free and paid tools for developers to use in GitHub Marketplace. GitHub Marketplace offers developers two types of tools: GitHub Actions and Apps, and each tool requires different steps for adding it to GitHub Marketplace.
GitHub Actions
Anyone can publish an action in GitHub Marketplace. GitHub verifies some partner organizations and these are shown as verified creators.
Reference:
https://docs.github.com/en/enterprise-cloud@latest/apps/github-marketplace/github-marketplace- overview/about-github-marketplace-for-apps
NEW QUESTION # 17
Which default GitHub environment variable indicates the name of the person or app that initiated a workflow?
- A. GITHUB_WORKFLOW_ACTOR
- B. GITHUB_ACTOR
- C. ENV_ACTOR
- D. GITHUB_USER
Answer: B
Explanation:
The GITHUB_ACTOR environment variable indicates the name of the person or app that initiated the workflow. This variable is automatically provided by GitHub in the workflow and can be used to identify the user or application triggering the workflow.
NEW QUESTION # 18
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?
- A. on:
pull_request:
types: [labeled]
branches:
- 'releases'
paths:
- 'apps/**' - B. on:
pull_request_review:
types: [labeled]
branches:
- 'releases'
paths:
- 'apps/**' - C. on:
pull_request:
types: [labeled]
branches:
- 'releases/**'
paths:
- 'apps' - D. on:
pull_request_label:
branches:
- 'releases'
paths:
- 'apps/**'
Answer: A
Explanation:
Incorrect:
[Not A] pull_request activitiy type labeled not specified.
pull_request_label is not a trigger.
[Not B] Specifies branches branches that has a name that starts with releases. We are only interested in the release branch.
branches:
- 'releases/**'
[Not C]
pull_request_review
Runs your workflow when a pull request review is submitted, edited, or dismissed. A pull request review is a group of pull request review comments in addition to a body comment and a state.
Reference:
https://docs.github.com/en/actions/reference/workflows-and-actions/events-that-trigger-workflows
NEW QUESTION # 19
In which locations can actions be referenced by workflows? (Choose three.)
- A. the runs-on: keyword of a workflow file
- B. an .action extension file in the repository
- C. the same repository as the workflow
- D. the repository's Secrets settings page
- E. a public NPM registry
- F. a separate public repository
- G. a published Docker container image on Docker Hub
Answer: C,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 # 20
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.)
- A. A workflow error produces too many, or wrong, requests, impacting external services negatively.
- B. A workflow sends requests to a service that is down.
- C. A workflow is configured to run on self-hosted runners
- D. A runner needs to have diagnostic logging enabled.
- E. A workflow needs to be changed from running on a schedule to a manual trigger
Answer: A,B
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.
NEW QUESTION # 21
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?
(Each correct answer presents a complete solution. Choose two.)
- A. A workflow is configured to run on self-hosted runners.
- B. A workflow error produces too many, or wrong, requests, impacting external services negatively.
- C. A workflow sends requests to a service that is down.
- D. A runner needs to have diagnostic logging enabled.
- E. A workflow needs to be changed from running on a schedule to a manual trigger.
Answer: B,C
Explanation:
Temporarily disabling a workflow can be useful in many scenarios. These are a few examples where disabling a workflow might be helpful:
[B] A workflow error that produces too many or wrong requests, impacting external services negatively.
A workflow that is not critical and is consuming too many minutes on your account.
[D] A workflow that sends requests to a service that is down.
Workflows on a forked repository that aren't needed (for example, scheduled workflows).
Reference:
https://docs.github.com/en/actions/how-tos/manage-workflow-runs/disable-and-enable-workflows
NEW QUESTION # 22
Which statement is true regarding the ability to delete a workflow run?
- A. Admin access is required to delete a workflow run.
- B. Workflow runs must be older than 30 days to be deleted.
- C. Completed workflow runs may be deleted.
- D. Pending workflow runs may be deleted.
Answer: C
Explanation:
Deleting a workflow run
You can delete a workflow run that has been completed, or is more than two weeks old.
Reference:
https://docs.github.com/en/enterprise-cloud@latest/actions/how-tos/manage-workflow- runs/delete-a-workflow-run
NEW QUESTION # 23
Which scopes are available to define custom environment variables within a workflow file?
(Choose three.)
- A. the entire stage, by using env at the top of the defined build stage
- B. the contents of a job within a workflow, by using jobs.env
- C. a specific step within a job, by using jobs..steps[*].env
- D. the entire workflow, by using env at the top level of the workflow file
- E. all jobs being run on a single Actions runner, by using runner.env at the top of the workflow file
- F. within the run attribute of a job step
Answer: B,C,D
Explanation:
Defining environment variables for a single workflow
To set a custom environment variable for a single workflow, you can define it using the env key in the workflow file. 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:
[A] The entire workflow, by using env at the top level of the workflow file.
[E] The contents of a job within a workflow, by using jobs.<job_id>.env.
[F] 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 # 24
You are a DevOps engineer working on custom Actions development. You need to handle the errors or exceptions as part of the JavaScript based action code. What should be added to the following code block to handle errors?
const core = require('@actions/core');
try {
// action code
} catch (error) {
<< insert snippet here >>
}
- A. action.setError(error.message);
- B. core.action.setException(error.message);
- C. core.setException(error.message);
- D. core.setFailed(error.message);
Answer: D
Explanation:
Setting a failure exit code in a JavaScript action
If you are creating a JavaScript action, you can use the actions toolkit @actions/core package to log a message and set a failure exit code. For example:
try {
// something
} catch (error) {
core.setFailed(error.message);
}
Reference:
https://docs.github.com/en/actions/how-tos/create-and-publish-actions/set-exit-codes
NEW QUESTION # 25
Which statement is true about using default environment variables?
- A. The GITHUB_WORKSPACE environment variable should be used to access files from within the runner.
- B. The environment variables can be set in the defaults: sections of the workflow
- C. The environment variables created should be prefixed with GITHUB_ to ensure they can be accessed in workflows
- D. The environment variables can be read in workflows using the ENV: variable_name syntax.
Answer: A
Explanation:
GITHUB_WORKSPACE is a default environment variable in GitHub Actions that points to the directory on the runner where your repository is checked out. This variable allows you to access files within your repository during the workflow.
NEW QUESTION # 26
What is the simplest action type to run a shell script?
- A. Docker container action
- B. Bash script action
- C. JavaScript action
- D. Composite action
Answer: C
Explanation:
Types of actions
Docker container actions. Docker containers package the environment with the GitHub Actions code. ...
JavaScript actions. JavaScript actions can run directly on a runner machine, and separate the action code from the environment used to run the code. ...
Composite Actions.
Note:
JavaScript actions
JavaScript actions can run directly on a runner machine, and separate the action code from the environment used to run the code. Using a JavaScript action simplifies the action code and executes faster than a Docker container action.
Reference:
https://docs.github.com/en/actions/concepts/workflows-and-actions/custom-actions
NEW QUESTION # 27
Which run: command will set a step's output?
- A. run: echo "MY_OUTPUT=foo" >> $GITHUB_OUTPUT
- B. run: echo ${{ $GITHUB_OUTPUT=foo }}
- C. run: echo "::set-env name=MY OUTPUT::foo"
- D. run: export MY_OUTPUT=foo
Answer: A
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 # 28
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 makes the action.yml file optional.
- C. It allows sharing workflow secrets with other users.
- D. It decouples the action's versioning from the versioning of other application code.
- E. It widens the scope of the code base for developers fixing issues and extending the action.
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 # 29
In GitHub Actions, where should you declare custom environment variables so they are accessible across all jobs and steps in a single workflow run?
- A. Runner command line arguments
- B. Environment secrets
- C. Repository variables
- D. Set env in the workflow YAML
Answer: D
Explanation:
The correct option is Set env in the workflow YAML because defining environment variables at the top level of a workflow makes them available to every job and step in that single run.
In a workflow file you can declare a top level mapping for environment variables with key value pairs. This top level scope propagates the values to all jobs and steps in the run and you can override them at job or step scope when necessary. This is the most direct way to share non secret configuration across the entire workflow execution.
NEW QUESTION # 30
As a developer, one of your workflows will require XCode version 11.2 hosted on macOS Catalina (i.e., v10.15). You've already created and configured a self-hosted runner to conform to those requirements and registered it with your organization. What else should you do to ensure that the workflow accesses the correct runner instance? (Each answer presents a complete solution. Choose three.)
- A. Create custom runner labels for macos-10.15 and xcode-11.2.
- B. In the workflow, specify:
runs-on: [ ${{groups.macos-10.15}}, ${{groups.xcode-11.2}} ]. - C. In the workflow, specify:
runs-on: [self-hosted, macos-10.15, xcode-11.2]. - D. Add your runner to the appropriate runner groups.
- E. Create runner groups named macos-10.15 and xcode-11.2.
- F. Assign the custom labels to the self-hosted runner.
Answer: A,C,F
Explanation:
[C, F] Using custom labels to route jobs
You can create custom labels and assign them to your self-hosted runners at any time. Custom labels let you send jobs to particular types of self-hosted runners, based on how they're labeled.
[E] Using default labels to route jobs
A self-hosted runner automatically receives certain labels when it is added to GitHub Actions.
These are used to indicate its operating system and hardware platform:
self-hosted: Default label applied to self-hosted runners.
linux, windows, or macOS: Applied depending on operating system.
x64, ARM, or ARM64: Applied depending on hardware architecture.
You can use your workflow's YAML to send jobs to a combination of these labels. In this example, a self-hosted runner that matches all three labels will be eligible to run the job:
runs-on: [self-hosted, linux, ARM64]
self-hosted - Run this job on a self-hosted runner.
linux - Only use a Linux-based runner.
ARM64 - Only use a runner based on ARM64 hardware.
Reference:
https://docs.github.com/en/actions/how-tos/manage-runners/self-hosted-runners/use-in-a- workflow
NEW QUESTION # 31
......
Microsoft GH-200 Exam Syllabus Topics:
| Topic | Details |
|---|---|
| Topic 1 |
|
| Topic 2 |
|
| Topic 3 |
|
| Topic 4 |
|
GH-200 2026 Training With 97 QA's: https://actualtorrent.realvce.com/GH-200-VCE-file.html