Pre-Winter Sale Limited Time Flat 70% Discount offer - Ends in 0d 00h 00m 00s - Coupon code: 70spcl

Microsoft GH-200 GitHub Actions Exam Exam Practice Test

Page: 1 / 14
Total 137 questions

GitHub Actions Exam Questions and Answers

Question 1

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

Options:

A.

Create a list of the actions that are restricted from being used as an enterprise policy. Every other action can be run.

B.

It is not possible; if an action is in the marketplace, its use cannot be restricted.

C.

Create a list that is maintained as a . yml file in a . github repository specified in the enterprise. Only these actions 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.

Question 2

A workflow that had been working now stalls in a waiting state until failing. The workflow file process_ml.yaml has not changed and contains jobs specifying runs-on: [gpu]. Which of the following steps would troubleshoot the issue?

(Each answer presents a complete solution. Choose two.)

Options:

A.

Review the contents of the Runner_*.log files in the _diag folder.

B.

Rotate the GITHUB_TOKEN secret for the appropriate runners.

C.

Check the Set up job step in the logs of the last successful run to determine the runner.

D.

Update the organization settings to enable GPU-based GitHub-hosted runners.

E.

Increase the usage limits for GitHub-hosted runners.

Question 3

Which of the following scenarios would require the use of self-hosted runners instead of GitHub-hosted runners?

Options:

A.

running more than the three concurrent workflows supported by GitHub-hosted runners

B.

exceeding 50,000 monthly minutes of build time

C.

using Docker containers as part of the workflow

D.

using specialized hardware configurations required for workflows

E.

performing builds on macOS

Question 4

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

Options:

A.

Use artifact storage.

B.

Use job outputs.

C.

Use the copy action with the cache parameter to cache the data.

D.

Use an external blob store

Question 5

What is the simplest action type to run a shell script?

Options:

A.

Docker container action

B.

Composite action

C.

Bash script action

D.

JavaScript action

Question 6

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?

Options:

A.

Configure a self-hosted runner on Windows with the requested tools.

B.

Use the YAML powershell: step.

C.

Run the pwsh2bash command to convert the script so it can be run on Linux.

D.

Use the YAML shell: pwsh in a run step.

E.

Use the actions/run-powershell action to invoke the script.

Question 7

What is the right method to ensure users approve a workflow before the next step proceeds?

Options:

A.

creating a branch protection rule and only allow certain users access

B.

granting users workflow approval permissions

C.

adding users as required reviewers for an environment

D.

granting users repository approval permissions

Question 8

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?

Options:

A.

environment variables

B.

workflow commands

C.

self-hosted runners

D.

enable debug loggingE composite run step

Question 9

Which of the following is a valid reusable workflow reference?

Options:

A.

uses: another-repo/workflow.yml@v1

B.

uses: octo-org/another-repo/.github/workflows/workflow.yml@v1

C.

uses: octo-org/another-repo/workflow.yml@v1

D.

uses: another-repo/.github/workflows/workflow.yml@v1

Question 10

What are the two ways to pass data between jobs? (Choose two.)

Options:

A.

Use the copy action with restore parameter to restore the data from the cache

B.

Use the copy action to save the data that should be passed in the artifacts folder.

C.

Use the copy action with cache parameter to cache the data

D.

Use data storage.

E.

Use job outputs

F.

Use artifact storage.

Question 11

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?

Options:

A.

Create repository secrets named DevCloud.DEPLOY_KEY and TestCloud.DEPLOY_KEY so that the reusable workflow parses the secrets by resource name.

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.

C.

Use a marketplace action to conditionally parse the DEPLOY_KEY repository secret based on the cloud resource name.

D.

Populate a DEPLOY_KEY repository secret with a JSON object containing DevCloud and TestCloud properties. Then specify DEPLOY_KEY.DevCloud in the secrets sections of the reusable workflow.

Question 12

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.)

Options:

A.

Specify the environment named Production in the workflow jobs that deploy to the VMs.

B.

Navigate to the organization settings and create a Production environment with the VMOps team as a required reviewer.

C.

Navigate to the repository settings and create a Production environment with the VMOps team as a required reviewer.

D.

Specify the VMOps team as the owner of the environment.

E.

Add the VMs to the environment.

Question 13

What is a valid scenario regarding environment secrets?

Options:

A.

Ensuring a job cannot access environment secrets until approval is obtained from a required reviewer.

B.

Ensuring only a specific step can access an environment secret.

C.

Configuring environment secrets for connecting to GitHub Enterprise Server.

D.

Configuring environment secrets to automatically pull from Azure Key Vault.

Question 14

What menu options in a repository do you need to select in order to use a starter workflow that is provided by your organization?

Options:

A.

Actions > Load workflow

B.

Workflow > New workflow

C.

Workflow > Load workflow

D.

Actions > New workflow

Question 15

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.)

Options:

A.

It makes it easier for the GitHub community to discover the action.

B.

It decouples the action ' s versioning from the versioning of other application code.

C.

It allows sharing workflow secrets with other users.

D.

It widens the scope of the code base for developers fixing issues and extending the action.

E.

It makes the action.yml file optional.

Question 16

As a developer, you have configured an IP allow list on a GitHub organization. Which effects does the IP allow list have on GitHub Actions?

(Each correct answer presents a complete solution. Choose two.)

Options:

A.

You must allow GitHub Actions ' IP address ranges in order to use Marketplace actions.

B.

You can use standard GitHub-hosted runners since their IP addresses are automatically allowed.

C.

You can use GitHub-hosted larger runners since they can be configured with static IP addresses.

D.

You can use self-hosted runners with known IP addresses.

Question 17

As a developer, how can you identify a Docker container action on GitHub?

Options:

A.

The action ' s repository includes @actions/core in the root directory.

B.

The action ' s repository name includes the keyword " Docker. "

C.

The action.yml metadata file references a Dockerfile file.

D.

The action.yml metadata file has the runs.using value set to Docker.

Question 18

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?

Options:

A.

check_run

B.

workflow_run

C.

workflow_call

D.

pull_request

Question 19

Which statement is true regarding the ability to delete a workflow run?

Options:

A.

Completed workflow runs may be deleted.

B.

Pending workflow runs may be deleted.

C.

Workflow runs must be older than 30 days to be deleted.

D.

Admin access is required to delete a workflow run.

Question 20

How can a workflow deployment mitigate the risk of multiple workflow runs deploying to a single cloud environment simultaneously?

(Each correct answer presents part of the solution. Choose two.)

Options:

A.

Pass the mutex into the deployment job.

B.

Configure the mutex setting in the environment.

C.

Specify a concurrency scope in the workflow.

D.

Specify a target environment in the deployment job.

E.

Set the concurrency in the deployment job to 1.

F.

Reference the mutex in the task performing the deployment.

Question 21

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

Options:

A.

automatic patching of both the runner and the underlying OS

B.

automatic file-system caching between workflow runs

C.

support for Linux, Windows, and mac

D.

support for a variety of Linux variations including CentOS, Fedora, and Debian

E.

requiring a payment mechanism (e.g., credit card) to use for private repositories

Question 22

Which workflows can use an action stored in an internal repository when repository access is enabled for the organization or enterprise?

(Each correct answer presents a complete solution. Choose two.)

Options:

A.

Workflows in internal repositories owned by the same organization or enterprise.

B.

Workflows in private repositories owned by an organization in the enterprise.

C.

Workflows in selected public repositories outside the enterprise.

D.

Workflows in public repositories owned by the same organization as the enterprise.

Question 23

As a DevOps engineer developing a JavaScript action, you need to include annotations to pass warning messages to workflow runners. Which code snippet can you use to implement an annotation in your Actions?

As a DevOps engineer developing a JavaScript action, you need to include annotations to pass warning messages to workflow runners. Which code snippet can you use to implement an annotation in your Actions?

Options:

A.

core.info( ' Something went wrong, but it\ ' s not bad enough to fail the build. ' )

B.

core.notice( ' Something went wrong, but it\’s not bad enough to fail the build. ' )

C.

core.warning( ' Something went wrong, but it\ ' s not bad enough to fail the build. ' )

D.

core.warn( ' Something went wrong, but it\ ' s not bad enough to fail the build. ' )

Question 24

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?

Options:

A.

Add the workflow_run webhook event as a trigger for the workflow for the code quality integration name

B.

Add the check_run webhook event as a trigger for the workflow when the code quality integration is completed

C.

Add the pull_request webhook event as a trigger for the workflow when the code quality integration is synchronized

D.

Add the deployment webhook event as a trigger for the workflow when the code quality integration is completed

Question 25

Which action type should be used to bundle a series of run steps into a reusable custom action?

Options:

A.

Composite action

B.

Bash script action

C.

Docker container action

D.

JavaScript action

Question 26

What are the most significant advantages of adding documentation while distributing custom actions?

(Each answer presents a complete solution. Choose two.)

Options:

A.

It shares the description of the action with users.

B.

It creates a README.md for the consuming workflow.

C.

It provides an example of the action.

D.

It generates autocomplete when using the action in a workflow.

Question 27

You need to use a specific version of an action. How should you use v1 of an actions/javascript-action repository in your workflow?

Options:

A.

steps:uses: actions/javascript-action/v1

B.

steps:uses: actions/javascript-actionversion: v1

C.

steps:uses: actions/javascript-action-v1

D.

steps:uses: actions/javascript-action@v1

Question 28

In the following workflow file, line 5 interprets lines 3 and 4 as Python. Which of the following is a valid option to complete line 5?

1 steps:

2 - run: |

3 import os

4 print(os.environ[ ' PATH ' ])

5

Options:

A.

with: python

B.

shell: bash

C.

working-directory: .github/python

D.

shell: python

Question 29

Where should workflow files be stored to be triggered by events in a repository?

Options:

A.

.github/workflows/

B.

.github/actions/

C.

Nowhere; they must be attached to an act on in the GitHub user interface

D.

anywhere

E.

.workflows/

Question 30

As a DevOps engineer, you are developing a container action. You need to execute a cleanup script after completing the main script execution. Which code block should be used to define the cleanup script?

Options:

A.

B.

C.

D.

Question 31

When should you use the GITHUB_TOKEN in a workflow?

Options:

A.

When you want to make authenticated calls to the GitHub API.

B.

When you want to connect to the runner via SSH.

C.

When you want to access repository-level secrets.

D.

When you want to call an action from GitHub Marketplace.

Question 32

What are the advantages of using a matrix strategy in a job definition? (Choose two.)

Options:

A.

It can test code in multiple versions of a programming language.

B.

It can decrease the costs for running multiple combinations of programming language/operating systems.

C.

It can run up to 512 jobs per workflow run.

D.

It can test code in multiple operating systems.

Question 33

Which of the following commands will set the $FOO environment variable within a script, so that it may be used in subsequent workflow job steps?

Options:

A.

run: echo " ::set-env name=FOO::bar "

B.

run: echo " FOO=bar " > > $GITHUB_ENV

C.

run: echo ${{ $FOO=bar }}

D.

run: export FOO=bar

Question 34

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?

Options:

A.

self-hosted: [windows-x64]

B.

runs-on: [self-hosted, windows, x64]

C.

runs-on: windows-latest

D.

self-hosted: [windows, x64]

Question 35

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

Options:

A.

GITHUB_TAG

B.

GITHUB_REF

C.

ENV_BRANCH

D.

GITHUB_BRANCH

Question 36

Based on the YAML below, which two statements are correct? (Choose two.)

Options:

A.

This workflow will publish a package to an npm registry.

B.

This workflow will publish a package to GitHub Packages.

C.

This workflow file is using a matrix strategy.

D.

The workflow job publish-npm will only run after the build job passes.

Question 37

As a developer, which of the following snippets will enable you to run the commands npm ci and npm run build as part of a workflow?

Options:

A.

- run: |

npm ci

npm run build

B.

- shell:

npm ci

npm run build

C.

- shell: |

npm ci

npm run build

D.

- run:

npm ci

npm run build

Question 38

Which of the following statements are true regarding the use of GitHub Actions on a GitHub Enterprise Server instance? (Choose three.)

Options:

A.

Use of GitHub Actions on GitHub Enterprise Server requires a persistent internet connection

B.

Actions created by GitHub are automatically available and cannot be disabled

C.

Most GitHub authored actions are automatically bundled for use on GitHub Enterprise Server

D.

Third party actions can be used on GitHub Enterprise Server by configuring GitHub Connect

E.

Actions must be defined in the .github repository

F.

Third party actions can be manually synchronized for use on GitHub Enterprise Server

Question 39

How many jobs will result from the following matrix configuration?

Options:

A.

3 jobs

B.

4 jobs

C.

5 jobs

D.

6 jobs

Question 40

Which of the following is the most common way to target a specific major release version?

Options:

A.

steps:uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c

B.

steps:uses: actions/checkout@U1673995124

C.

steps:uses: actions/checkout@v3

D.

steps:uses: actions/checkout

Question 41

As a developer, you are using a Docker container action in your workflow. What is required for the action to run successfully?

Options:

A.

The job env must be set to a Linux environment.

B.

The job runs-on must specify a Linux machine with Docker installed.

C.

The referenced action must be hosted on Docker Hub.

D.

The action must be published to the GitHub Marketplace.

Page: 1 / 14
Total 137 questions