
Verified GH-200 Dumps Q&As - GH-200 Test Engine with Correct Answers
Pass Your GH-200 Dumps as PDF Updated on 2026 With 102 Questions
Microsoft GH-200 Exam Syllabus Topics:
| Topic | Details |
|---|---|
| Topic 1 |
|
| Topic 2 |
|
| Topic 3 |
|
| Topic 4 |
|
NEW QUESTION # 15
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. creating a branch protection rule and only allow certain users access
- C. granting users repository approval permission
- D. granting users workflow approval permissions
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.
Note: Managing environments for deployment
You can create environments and secure those environments with deployment protection rules. A job that references an environment must follow any protection rules for the environment before running or accessing the environment's secrets.
Optionally, you can specify people or teams that must approve workflow jobs that use this environment.
Select Required reviewers.
Enter up to 6 people or teams. Only one of the required reviewers needs to approve the job for it to proceed.
Optionally, to prevent users from approving workflows runs that they triggered, select Prevent self-review.
Click Save protection rules.
Reference:
https://docs.github.com/en/actions/how-tos/deploy/configure-and-manage-deployments/manage- environments
NEW QUESTION # 16
You need to store an API key in a GitHub repository. The solution must ensure that the key remains secure and can be used in a GitHub Actions workflow. What should you do?
- A. Commit the key to the repository in an .env file.
- B. Add the key as a plain text variable to the repository README file.
- C. Use repository secrets to encrypt and store the key, and then reference the key in the workflow YAML file.
- D. Store the key directly in the workflow YAML file under env:.
Answer: C
Explanation:
To use a specific API key in your GitHub Actions workflow, you can store it as a Repository Secret and reference it using the secrets context in your YAML file. This ensures the key is encrypted and masked in your workflow logs.
1. Store the API Key as a Secret
Navigate to your repository on GitHub.com.
Click Settings > Secrets and variables > Actions.
Select the Secrets tab and click New repository secret.
In the Name field, enter a descriptive identifier (e.g., MY_API_KEY).
Rules: Use only alphanumeric characters or underscores; cannot start with a number or GITHUB_.
In the Secret field, paste your API key value and click Add secret.
2. Reference the Secret in your YAML File
In your .github/workflows/your-workflow.yml file, access the secret using the syntax
${{ secrets.NAME_OF_SECRET }}. It is a best practice to map it to an environment variable within a specific step rather than echoing it directly.
Example Workflow in yaml:
name: Use API Key Example
on: [push]
jobs:
my-job:
runs-on: ubuntu-latest
steps:
- name: Run script with API Key
# Map the secret to an environment variable for the runner
env:
API_KEY: ${{ secrets.MY_API_KEY }}
run: |
# Use the environment variable in your commands
curl -H "Authorization: Bearer $API_KEY" https://api.example.com
Reference:
https://docs.github.com/actions/security-guides/using-secrets-in-github-actions
NEW QUESTION # 17
What are the two ways to pass data between jobs? (Each correct answer presents part of the solution. Choose two.)
- A. Use the copy action to save the data that should be passed in the artifacts folder.
- B. Use artifact storage.
- C. Use the copy action with cache parameter to cache the data.
- D. Use job outputs.
- E. Use data storage.
- F. Use the copy action with restore parameter to restore the data from the cache.
Answer: B,D
Explanation:
Passing information between jobs
[D] Store and share data with workflow artifacts
Use artifacts to share data between jobs in a workflow and store data once that workflow has completed.
[E] You can define outputs to pass information from one job to another.
Reference:
https://docs.github.com/en/actions/tutorials/store-and-share-data
https://docs.github.com/en/actions/how-tos/write-workflows/choose-what-workflows-do/pass-job- outputs
NEW QUESTION # 18
Which default GitHub environment variable indicates the name of the person or app that initiated a workflow?
- A. GITHUB_WORKFLOW_ACTOR
- B. GITHUB_USER
- C. GITHUB_ACTOR
- D. ENV_ACTOR
Answer: C
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 # 19
In which locations can actions be referenced by workflows? (Each correct answer presents a complete solution. Choose three.)
- A. a public NPM registry
- B. the same repository as the workflow
- C. the runs-on: keyword of a workflow file
- D. a separate public repository
- E. the repository's Secrets settings page
- F. a published Docker container image on Docker Hub
- G. an .action extension file in the repository
Answer: A,D,F
Explanation:
Adding an action to your workflow
You can add an action to your workflow by referencing the action in your workflow file. The actions you use in your workflow can be defined in:
[F] The same repository as your workflow file
[C] Any public repository
[B] A published Docker container image on Docker Hub
Note: Adding an action from the same repository [F]
If an action is defined in the same repository where your workflow file uses the action, you can reference the action with either the {owner}/{repo}@{ref} or ./path/to/dir syntax in your workflow file.
Reference:
https://docs.github.com/en/actions/how-tos/write-workflows/choose-what-workflows-do/find-and- customize-actions
NEW QUESTION # 20
As a developer, you created a JavaScript action. What is the best way to test your JavaScript action?
- A. Create a workflow that only executes your specific JavaScript action.
- B. Package your JavaScript action inside a docker container image and run it.
- C. Use a tool called @vercel/ncc to compile your code.
- D. Create a workflow that includes the actions/debug-javascript action.
Answer: A
Explanation:
Testing out your JavaScript action in a workflow
You can test your action out in a workflow.
Public actions can be used by workflows in any repository. When an action is in a private repository, the repository settings dictate whether the action is available only within the same repository or also to other repositories owned by the same user or organization.
Reference:
https://docs.github.com/en/actions/tutorials/create-actions/create-a-javascript-action
NEW QUESTION # 21
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.)
- A. Store the token as an organizational-level encrypted secret in GitHub. During deployment, use GitHub Actions to store the secret in an environment variable that can be accessed at runtime.
- B. Store the token as a GitHub encrypted secret in the same repo as the code. Create a reusable custom GitHub Action to access the token by the microservice at runtime.
- C. Store the token as a GitHub encrypted secret in the same repo as the code. During deployment, use GitHub Actions to store the secret in an environment variable that can be accessed at runtime.
- D. Store the token in a configuration file in a private repository. Use GitHub Actions to deploy the configuration file to the runtime environment.
- E. Use a corporate non-GitHub secret store (e.g., HashiCorp Vault) to store the token. During deployment, use GitHub Actions to store the secret in an environment variable that can be accessed at runtime.
Answer: A,E
Explanation:
Using a corporate secret store like HashiCorp Vault provides a secure, centralized location for sensitive information. GitHub Actions can then retrieve and store the token securely during deployment by setting it as an environment variable, ensuring the token remains secure and accessible at runtime.
Storing the token as an organizational-level encrypted secret in GitHub ensures it is accessible across multiple repositories, minimizing management overhead. GitHub Actions can then use this secret during deployment by setting it as an environment variable, allowing the microservice to access it securely at runtime.
NEW QUESTION # 22
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. Build the container image.
- B. Authenticate to the GitHub Container Registry.
- C. Push the image to the GitHub Container Registry.
- D. Pull the image from the GitHub Container Registry.
- E. Use the actions/setup-docker action.
Answer: A,B,C
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 # 23
What is the simplest action type to run a shell script?
- A. Composite action
- B. JavaScript action
- C. Bash script action
- D. Docker container action
Answer: A
Explanation:
The simplest official GitHub Actions action type for running shell commands or shell scripts is a composite action. Composite actions allow an action author to combine one or more run steps and reusable workflow commands in an action.yml file without needing to package a Docker image or write a JavaScript action.
Option B is correct because it directly supports shell-based automation. Option A is heavier because Docker container actions require a container image or Dockerfile. Option D is used when the action logic is written in JavaScript and executed with Node.js. Option C is incorrect because "Bash script action" is not an official GitHub Actions action type. This topic checks custom action types and reuse patterns.
NEW QUESTION # 24
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. path: the file path on the runner to cache or restore
- B. ref: the ref name of the branch to access and restore a cache created
- C. key: the key created when saving a cache and the key used to search for a cache
- D. dependency: the name and version of a package to cache or restore
- E. cache-hit: the copy action key used with restore parameter to restore the data from the cache
- F. restore-keys: the copy action key used with cache parameter to cache the data
Answer: A,C
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 # 25
Which statement accurately describes using labels to route GitHub Actions workflows to runners?
- A. To target a specific runner, the runs-on must match the runner's hostname rather than its labels.
- B. A user can assign multiple labels to a self-hosted runner and use the labels in a runs-on to target only runners that match all the specified labels.
- C. Labels apply only to GitHub-hosted runners and are ignored by self-hosted runners.
- D. GitHub Actions automatically assigns the runner's IP address as a label, and the label must be used in a runs-on.
Answer: B
Explanation:
Self-hosted runners can have default labels and custom labels. These labels are used in the runs-on field to route workflow jobs to runners that match the required criteria. When multiple labels are specified, the runner must match all listed labels before GitHub Actions can assign the job to that runner. Therefore, option A is correct. Option B is false because labels are especially important for self-hosted runners. Option C is incorrect because GitHub does not require the runner IP address as a routing label. Option D is also incorrect because workflows target runners by labels or runner groups, not by hostname. This topic validates runner selection, self-hosted runner configuration, and workflow job routing.
NEW QUESTION # 26
Which of the following scenarios would require the use of self-hosted runners instead of GitHub-hosted runners?
- A. using specialized hardware configurations required for workflows
- B. performing builds on macOS
- C. using Docker containers as part of the workflow
- D. running more than the three concurrent workflows supported by GitHub-hosted runners
- E. exceeding 50,000 monthly minutes of build time
Answer: A,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 # 27
As a developer, what two options should you recommend to implement standards for automation reuse? Each correct answer presents a complete solution. NOTE: Each correct answer is worth one point.
- A. Create reusable actions and workflows that can be called from other workflows.
- B. Create a marketplace partition to publish reusable automation for the company.
- C. Store shared corporate actions in subfolders in a defined and documented internally accessible repository.
- D. Create workflow templates and store them in the organization's .github repository.
Answer: A,C
Explanation:
[A]
Implementing standards for reusable actions and workflows is the most effective way to reduce duplication and maintain consistency across your GitHub organization.
Reusable Workflows (workflow_call)
Best for standardizing entire processes (e.g., a complete CI/CD pipeline).
Location: Defined in .github/workflows/ of a central repository.
Trigger: Use the on: workflow_call trigger to define inputs, secrets, and outputs.
Usage: Called from another workflow using the uses keyword (e.g.,
owner/repo/.github/workflows/ci.yml@v1).
Benefit: They allow you to enforce security scans, build steps, and deployment gates across multiple repositories from a single source
[C]
Implementing a marketplace partition for internal GitHub Actions is a key strategy for scaling automation securely and efficiently across a company. This centralized approach ensures that developers use vetted, high-quality automation while adhering to corporate standards.
Strategic Implementation of Internal Reuse
To implement standards for automation reuse effectively, focus on these core components:
[C] Internal Actions Marketplace: Create a dedicated organization or specific repositories to host and display shared actions. This "marketplace" acts as a curated directory of approved automations, preventing the use of unverified third-party actions from the public marketplace.
Workflow Templates: Store standardized workflow templates in your organization's .github repository. These templates appear in the "Actions" tab when a user creates a new workflow, ensuring consistency across different teams.
[A] Reusable Workflows: Design modular workflows that can be called by other repositories using the uses keyword. Unlike standard actions, these can manage entire jobs and runners, making them ideal for standardizing complex CI/CD pipelines.
Internal Repository Sharing: Set repository visibility to Internal and configure Actions permissions to allow access from other repositories in the organization or enterprise.
Reference:
https://www.incredibuild.com/blog/best-practices-to-create-reusable-workflows-on-github-actions
https://xebia.com/blog/setting-up-an-internal-github-actions-marketplace
NEW QUESTION # 28
Which scopes are available to define custom environment variables within a workflow file?
(Choose three.)
- A. the contents of a job within a workflow, by using jobs.env
- B. the entire workflow, by using env at the top level of the workflow file
- C. a specific step within a job, by using jobs..steps[*].env
- D. the entire stage, by using env at the top of the defined build stage
- 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: A,B,C
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 # 29
Which repository files are required for a Docker container action and for a JavaScript action to run correctly? (Choose 3)
- A. package.json
- B. Container action Dockerfile
- C. JavaScript entry file such as main.js or index.js
- D. Action metadata file action.yml or action.yaml
Answer: B,C,D
Explanation:
The correct options are JavaScript entry file such as main.js or index.js, Action metadata file action.yml or action.yaml, and Container action Dockerfile.
The Action metadata file action.yml or action.yaml is mandatory because it declares inputs and outputs and it instructs GitHub how to run the action. Both JavaScript and container actions rely on this metadata to execute correctly.
For a JavaScript action the JavaScript entry file such as main.js or index.js is the script that the runner executes as directed by the metadata. GitHub expects a committed distributable script, so the entry file must be present in the repository.
For a container action the Container action Dockerfile defines how to build the image and what command to run, which makes the Dockerfile required for the action to work.
NEW QUESTION # 30
......
Pass Microsoft GH-200 Exam Info and Free Practice Test: https://dumps4download.actualvce.com/Microsoft/GH-200-valid-vce-dumps.html