97 Exam Questions for GH-200 Updated Versions With Test Engine [Q48-Q73]

Share

97 Exam Questions for GH-200 Updated Versions With Test Engine

Pass GH-200 Exam with Updated GH-200 Exam Dumps PDF 2026


Microsoft GH-200 Exam Syllabus Topics:

TopicDetails
Topic 1
  • 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.
Topic 2
  • 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 3
  • 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 4
  • 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.

 

NEW QUESTION # 48
While writing a custom action, some behavior within the runner must be changed. Which workflow commands would set an error message in the runner's output? (Each correct answer presents a complete solution. Choose two.)

  • A. echo "::error message=There was an error::"
  • B. echo "::error file=main.py,line=10,col=15::There was an error"
  • C. echo "::error::There was an error"
  • D. echo "::error=There was an error::"

Answer: B,C

Explanation:
To set an error message in a GitHub Actions runner's output, you should use the command echo
"::error::Your error message" in your workflow's run step. This workflow command creates an error annotation that will appear in the logs, and you can optionally include file and line number information, such as echo "::error file=app.js,line=5::Error message".
Reference:
https://docs.github.com/en/actions/reference/workflows-and-actions/workflow-commands


NEW QUESTION # 49
Which scopes are available to define custom environment variables within a workflow file? (Choose three.)

  • A. a specific step within a job, by using jobs.<job_id>.steps[*].env
  • B. the entire workflow, by using env at the top level of the workflow file
  • C. the contents of a job within a workflow, by using jobs.<job_id>.env
  • D. within the run attribute of a job step
  • E. the entire stage, by using env at the top of the defined build stage
  • F. all jobs being run on a single Actions runner, by using runner.env at the top of the workflow file

Answer: A,B,D

Explanation:
You can define environment variables for the entire workflow by using the env key at the top level of the workflow file. These environment variables will be available to all jobs and steps within the workflow.
Environment variables can also be set within the run attribute of a job step, and these variables will be scoped only to that specific step.
You can set environment variables for specific steps within a job by using jobs.<job_id>.steps[*].env, which allows you to define variables that will only be available to that step.


NEW QUESTION # 50
Which configuration lines correctly set the workflow name in a GitHub Actions workflow file?
(Choose 2)

  • A. name: ${{ "release-flow-42" }}
  • B. name: release-flow-42
  • C. run-name: release-flow-42
  • D. name: ${{ 'release-flow-42' }}

Answer: B,D

Explanation:
The correct options are name: release-flow-42 and name: ${{ 'release-flow-42' }}. Both set the workflow name that appears in the Actions interface and on the workflow page.
The plain static name key with a simple string sets the workflow name clearly and predictably. It is the most straightforward way to define the workflow title.
The expression form with a single quoted string evaluates to the same literal value. GitHub Actions accepts a string result for the workflow name, so this produces a valid name while keeping consistency with other places where expressions are used.


NEW QUESTION # 51
Custom environment variables can be defined at multiple levels within a workflow file including:
(Each answer presents a complete solution. Choose three.)

  • A. job level.
  • B. runner level.
  • C. top level.
  • D. stage level.
  • E. default level.
  • F. step level.

Answer: A,C,F

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:
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 # 52
Which workflow event is used to manually trigger a workflow run?

  • A. status
  • B. workflow_run
  • C. create
  • D. workflow_dispatch

Answer: D

Explanation:
The workflow_dispatch event is used to manually trigger a workflow run in GitHub Actions. You can specify this event in the workflow file to allow users to manually trigger the workflow from the GitHub UI, often with optional input parameters.


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

  • A. Create a list that is maintained as a . yml file in a . github repository specified in the enterprise.
    Only these actions can be run.
  • B. It is not possible; if an action is in the marketplace, its use cannot be restricted.
  • C. Create a list of the actions that are restricted from being used as an enterprise policy. Every other action can be run.
  • D. Create a list of the actions that are allowed to run as an enterprise policy. Only these actions can be run.

Answer: D

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.
Note: To allow a specific list of actions at the GitHub Enterprise level, an administrator must navigate to Enterprise > Policies > Actions and select "Allow select actions". Then, from the dropdown menus, they choose "Allow selected actions and reusable workflows" and add the desired actions to the allowed list using the format OWNER/REPOSITORY@TAG-OR-SHA.
These actions can also include local actions, actions from specific organizations, or specific tags or commit SHAs.
Reference:
https://docs.github.com/en/enterprise-cloud@latest/admin/enforcing-policies/enforcing-policies- for-your-enterprise/enforcing-policies-for-github-actions-in-your-enterprise


NEW QUESTION # 54
How can GitHub Actions encrypted secrets be used in if: conditionals within a workflow job?

  • A. Create a job dependency that exposes the encrypted secret as a job output, which can then be leveraged in a subsequent dependent job.
  • B. Set the encrypted secret as a job-level environment variable and then reference the environment variable within the conditional statement.
  • C. Use a workflow command to expose the encrypted secret via a step's output parameter and then use the step output in the job's if: conditional.
  • D. Use the secrets context within the conditional statement, e.g. ${{ secrets.MySuperSecret }}.

Answer: D

Explanation:
GitHub Actions encrypted secrets can be accessed in workflows using the secrets context. You can directly reference the secret within an if: conditional using ${{ secrets.MySuperSecret }} to determine whether a job or step should run based on the secret's value.


NEW QUESTION # 55
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? (Each correct answer presents a complete solution. Choose two.)

  • A. 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.
  • B. Store the token in a configuration file in a private repository. Use GitHub Actions to deploy the configuration file to the runtime environment.
  • C. 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.
  • D. 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.
  • E. 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.

Answer: C,D

Explanation:
[B] 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.
[C] 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 # 56
Which step is using the dbserver environment variable correctly?

  • A. steps:
    - name: Hello world
    run: echo $dbserver
    env:
    dbserver: orgserver1
  • B. steps:
    - name: Hello world
    run: echo $dbserver
    environment:
    dbserver: orgserver1
  • C. steps:
    - name: Hello world
    run: echo $dbserver
    env:
    - name: dbserver
    value: orgserver1
  • D. steps:
    - name: Hello world
    run: echo $dbserver
    variables:
    dbserver: orgserver1

Answer: A

Explanation:
Store information in variables
GitHub sets default variables for each GitHub Actions workflow run. You can also set custom variables for use in a single workflow or multiple workflows.
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:
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 # 57
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?
(Each correct answer presents a complete solution. Choose three.)

  • A. self-hosted runners
  • B. workflow templates
  • C. encrypted secrets
  • D. actions stored in an organizational partition in the GitHub Marketplace
  • E. actions stored in private repositories in the organization
  • F. custom Docker actions stored in GitHub Container Registry

Answer: B,C,E

Explanation:
[D] Encrypted secrets can be accessed across repositories in the same organization, making it easy to store sensitive data (like API keys or tokens) securely while allowing multiple workflows to access them.
[E] Workflow templates allow you to create reusable templates for workflows that can be shared across repositories within the organization. This makes it easier to standardize processes and automate them across multiple projects.
[F] Actions stored in private repositories within the organization can be reused across all repositories by referencing them in workflows. This ensures a centralized way of maintaining custom actions.
Reference:
https://docs.github.com/en/actions/how-tos/reuse-automations/reuse-workflows


NEW QUESTION # 58
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?

  • A.
  • B.
  • C.
  • D.

Answer: D

Explanation:
Use keywords strategy and matrix in that order.
Last line should be node-version: ${{ matrix.node-ver}}
Reference:
https://docs.github.com/en/actions/how-tos/write-workflows/choose-what-workflows-do/run-job- variations


NEW QUESTION # 59
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 self-hosted runner is running a Linux operating system.
  • C. The service status of Kubernetes is "active".
  • D. The self-hosted runner is running a Windows operating system.
  • E. Kubernetes is installed on the self-hosted runner.

Answer: A,B

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 # 60
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?

  • A. The Codespace secret doesn't match the expected value.
  • B. There is a different value specified at the enterprise level.
  • C. The Encrypt Secret setting was not configured for the secret.
  • D. There is a different value specified at the rego level.
  • E. There is a different value specified at the workflow level.

Answer: D

Explanation:
GitHub secrets are defined at different levels: organization, repository, and sometimes at the workflow level. If a secret is defined at both the organization level and the repository level, the repository-level secret will take precedence. So, if the value of the secret differs between these levels, the workflow will use the value from the repository level instead of the organization level.


NEW QUESTION # 61
What is the minimal syntax for declaring an output named foo for an action?

  • A.
  • B.
  • C.
  • D.

Answer: B

Explanation:
The correct minimal syntax for declaring an output in GitHub Actions is by using the foo key under outputs, and associating it with a value (in this case, Some value). This is the simplest form to define an output in a workflow or action.


NEW QUESTION # 62
What are the most significant advantages of adding documentation while distributing custom actions? (Each answer presents a complete solution. Choose two.)

  • A. It shares the description of the action to the users.
  • B. It provides an example of the action.
  • C. It generates auto completion when using the action in a workflow.
  • D. It creates a readme.md for the consuming workflow.

Answer: A,D


NEW QUESTION # 63
Which default GitHub environment variable indicates the name of the person or app that initiated a workflow?

  • A. GITHUB_USER
  • B. ENV_ACTOR
  • C. GITHUB_ACTOR
  • D. GITHUB_WORKFLOW_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 # 64
Which files are required for a Docker container action in addition to the source code? (Each correct answer presents a partial solution. Choose two.)

  • A. action.yml
  • B. metadata.yml
  • C. Actionfile
  • D. Dockerfile

Answer: A,D

Explanation:
Creating a Docker container action
Create a dockerfile
Dockerfile support for GitHub Actions
When creating a Dockerfile for a Docker container action, you should be aware of how some Docker instructions interact with GitHub Actions and an action's metadata file.
Creating an action metadata file
Create a new action.yml file.
Reference:
https://docs.github.com/en/actions/tutorials/use-containerized-services/create-a-docker-container- action
https://docs.github.com/en/actions/reference/workflows-and-actions/dockerfile-support


NEW QUESTION # 65
As a developer, how can you identify a Docker container action on GitHub?

  • A. The action's repository includes @actions/core in the root directory.
  • B. The action.yml metadata file references a Dockerfile file.
  • C. The action's repository name includes the keyword "Docker."
  • D. The action.yml metadata file has the runs.using value set to Docker.

Answer: D

Explanation:
In a Docker container action, the action.yml file includes the runs.using field, which is set to docker to specify that the action runs inside a Docker container. This is the key indicator that the action is a Docker container action.


NEW QUESTION # 66
In a workflow triggered by a pull request comment, which GitHub Actions context property contains the event payload used to access the comment text and the pull request number?

  • A. github.event_path
  • B. github.repository
  • C. github.job
  • D. github.event

Answer: D

Explanation:
In a workflow that runs on a pull request comment the event context contains the webhook payload. With github.event you can read the structured fields for the comment text and the pull request number. The comment text is available under the comment body field and the pull request number is available under the issue number for comment events or under the pull request number for pull request events. This makes github.event the direct and convenient source for these values.


NEW QUESTION # 67
You have exactly one Windows x64 self-hosted runner, and it is configured with custom tools. Which syntax could you use in the workflow to target that runner?

  • A. self-hosted: [windows, x64]
  • B. runs-on: [self-hosted, windows, x64]
  • C. self-hosted: [windows-x64]
  • D. runs-on: windows-latest

Answer: B

Explanation:
The runs-on keyword allows you to specify the operating system and other labels for the runner. By specifying self-hosted, windows, and x64, you are targeting a self-hosted Windows runner that matches these criteria, which aligns with the custom configuration of your self-hosted runner.


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

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

Answer: B,C,D

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 # 69
How many jobs will result from the following matrix configuration?

  • A. 4 jobs
  • B. 6 jobs
  • C. 3 jobs
  • D. 5 jobs

Answer: B

Explanation:
The matrix configuration specifies two variables: color and animal. The color variable has 2 values (green and pink), and the animal variable has 2 values (owl and magpie). This would result in 4 combinations (2 color values × 2 animal values). Additionally, the include section introduces two more combinations (color: blue and animal: owl; color: pink and animal: magpie).


NEW QUESTION # 70
As a developer, you need to add the correct syntax to allow the following workflow file to be triggered by multiple types of events. Which two code blocks should you add starting at line 5?
(Each correct answer presents a complete solution. Choose two.)

  • A. on:
    branches:
    - 'main'
    - 'dev'
  • B. on:
    push:
    branches:
    - main
    release:
    types:
    - created
  • C. on:
    schedule:
    - cron: '*/15 * * * *'
    initiate:
    - 'main'
  • D. on: [push, pull_request]
  • E. on: [push, commit]
  • F. on:
    env:
    - 'prod'
    - 'qa'
    - 'test'

Answer: C

Explanation:
To automatically trigger a workflow, use on to define which events can cause the workflow to run.
You can define single or multiple events that can trigger a workflow, or set a time schedule. You can also restrict the execution of a workflow to only occur for specific files, tags, or branch changes.
[A] push and pull_request are both events that can trigger a workflow.
Note: Using multiple events
You can specify a single event or multiple events. For example, a workflow with the following on value will run when a push is made to any branch in the repository or when someone forks the repository:
on: [push, fork]
If you specify multiple events, only one of those events needs to occur to trigger your workflow. If multiple triggering events for your workflow occur at the same time, multiple workflow runs will be triggered.
[C] on.schedule
You can use on.schedule to define a time schedule for your workflows.
Reference:
https://docs.github.com/en/actions/reference/workflows-and-actions/workflow-syntax
https://docs.github.com/en/actions/reference/workflows-and-actions/events-that-trigger-workflows


NEW QUESTION # 71
In which locations can actions be referenced by workflows? (Each correct answer presents a complete solution. Choose three.)

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

Answer: C,D,E

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 # 72
Which statement is true regarding the ability to delete a workflow run?

  • A. Admin access is required to delete a workflow run.
  • B. Completed workflow runs may be deleted.
  • C. Pending workflow runs may be deleted.
  • D. Workflow runs must be older than 30 days to be deleted.

Answer: B

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 # 73
......

GH-200 Exam Dumps - Free Demo & 365 Day Updates: https://www.prep4sureexam.com/GH-200-dumps-torrent.html

Free Sales Ending Soon - Use Real GH-200 PDF Questions: https://drive.google.com/open?id=1g1jjUv7wCPqWrcXtm-oUqGl-ea5J74cp