Last Chance Black Friday Deal: Take 75% Off! Use coupon code below to secure your exam bundles! - Ends in 0d 00h 00m 00s - Coupon code: my75ex

Home > Microsoft > GitHub Administrator > GH-200

GH-200 GitHub Actions Exam Question and Answers

Question # 4

What are the two mandatory requirements for publishing GitHub Actions to the GitHub Marketplace? Each correct answer presents part of the solution.

NOTE: Each correct answer is worth one point.

A.

The action can be either in a public or private repository.

B.

The action’s name cannot match a user or organization on GitHub unless the user or organization owner is publishing the action.

C.

Each repository can contain a collection of actions as long as they are under the same Marketplace category.

D.

The action’s metadata file must be in the root directory of the repository.

E.

The name should match with one of the existing GitHub Marketplace categories.

Full Access
Question # 5

Which run: command will set a step ' s output?

A.

run: echo " MY_OUTPUT=foo " > > $GITHUB_OUTPUT

B.

run: export MY_OUTPUT=foo

C.

run: echo ${{ $GITHUB_OUTPUT=foo }}

D.

run: echo " ::set-env name=MY OUTPUT::foo "

Full Access
Question # 6

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.

The self-hosted runner is running a Linux operating system.

B.

The self-hosted runner is running a Windows operating system.

C.

Docker is installed on the self-hosted runner.

D.

Kubernetes is installed on the self-hosted runner.

E.

The service status of Kubernetes is " active " .

Full Access
Question # 7
A.

Scheduled workflows run on the:

B.

latest commit and branch on which the workflow was triggered,

C.

latest commit from the branch named schedule,

D.

latest commit from the branch named main,

E.

specified commit and branch from the workflow YAML file,

F.

latest commit on the default or base branch

Full Access
Question # 8

As a developer, you want to review the step that caused a workflow failure and the failed step ' s build logs. First navigate to the main page of the repository on GitHub. Which section contains the step failure information?

A.

Insights

B.

Code

C.

Actions

D.

Pull requests

E.

Issues

Full Access
Question # 9

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

A.

ENV_ACTOR

B.

GITHUB_WORKFLOW_ACTOR

C.

GITHUB_ACTOR

D.

GITHUB_USER

Full Access
Question # 10

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.

A.

Define a workflow_dispatch event and specify inputs that enable users to provide values when triggering the workflow manually.

B.

Use a schedule event and add a manual: false parameter.

C.

Define a workflow_dispatch event in the on field of the workflow YAML file.

D.

Trigger a workflow manually by using a workflow_call event that has a button on the UI.

Full Access
Question # 11

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

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

Full Access
Question # 12

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?

A.

runs: using: " composite " steps: - run: $GITHUB_ACTION_PATH/script.sh directory: ${{ inputs.dir }} shell: bash

B.

runs: using: " composite " steps: - run: $GITHUB_ACTION_PATH/script.sh working-directory: ${{ inputs.dir }} shell: bash

Full Access
Question # 13

As a developer, what options should you recommend to implement standards for automation reuse? (Choose two.)

A.

Create workflow templates and store them in the organization ' s .github repository.

B.

Create reusable actions and workflows that can be called from other workflows.

C.

Create a marketplace partition to publish reusable automation for the company.

D.

Store shared corporate actions in subfolders in a defined and documented internally accessible repository.

Full Access
Question # 14

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

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.

Full Access
Question # 15

You have a GitHub repository that contains a Node.js project and a local action named Action1. Multiple jobs in repository workflows call Action1. Action1 installs dependencies, runs tests, and returns a generated report path to the calling workflows.

You need to ensure that Action1 meets the following requirements:

• Encapsulates multiple workflow steps without packaging a separate runtime

• Exposes the report path produced by the test step

How should you complete the metadata file? To answer, select the appropriate options in the answer area.

NOTE: Each correct selection is worth one point.

Full Access
Question # 16

Which of the following is the lowest repository permission you need to have for downloading workflow artifacts?

A.

Write

B.

Triage

C.

Maintain

D.

Read

E.

Admin

Full Access
Question # 17

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 two steps should you take? Each correct answer presents part of the solution.

NOTE: Each correct answer is worth one point.

A.

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

B.

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

C.

Specify the VMOps team as the owner of the environment.

D.

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

E.

Add the VMs to the environment.

Full Access
Question # 18

As a developer, you need to leverage Redis in your workflow. What is the best way to use Redis on a self-hosted Linux runner without affecting future workflow runs?

A.

Add a run step to your workflow, which dynamically installs and configures Redis as part of your job.

B.

Specify container: and services: in your job definition to leverage a Redis service container.

C.

Set up Redis on a separate machine and reference that instance from your job.

D.

Install Redis on the hosted runner image and place it in a runner group. Specify label: in your job to target the runner group.

Full Access
Question # 19

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

Full Access
Question # 20

You are reaching your organization ' s storage limit for GitHub artifacts and packages. What should you do to prevent the storage limit from being reached? (Choose two.)

A.

Delete artifacts from the repositories manually

B.

Disable branch protections in the repository.

C.

Use self-hosted runners for all workflow runs.

D.

Configure the artifact and log retention period.

E.

Configure the repo to use Git Large File Storage.

Full Access
Question # 21

When creating and managing custom actions in an enterprise setting, which of the following is considered a best practice?

A.

creating a separate repository for each action so that the version can be managed independently

B.

creating a separate branch in application repositories that only contains the actions

C.

creating a single repository for all custom actions so that the versions for each action are all the same

D.

including custom actions that other teams need to reference in the same repository as application code

Full Access
Question # 22

What are the two most significant advantages of adding documentation while distributing custom actions? Each correct answer presents a complete solution.

NOTE: Each correct answer is worth one point.

A.

It creates a readme.md for the consuming workflow.

B.

It shares the description of the action to the users.

C.

It provides an example of the action.

D.

It generates auto completion when using the action in a workflow.

Full Access
Question # 23

You have a GitHub Enterprise Cloud Organization that contains private repositories for three apps. The workflow of each app has a job that uses repository secrets and calls a shared deployment action.

You plan to replace separate deployment scripts with a single custom action.

You need to recommend a distribution and versioning approach for the custom action. The solution must meet the following requirements:

    The action repository must be private.

    Only specific application repositories can use the action.

    The workflow reference must be resistant to changes in the action repository without requiring a workflow file change.

What should you recommend?

A.

Store the custom action in a public repository.

Publish the action to GitHub Marketplace.

Reference the action by using a full-length commit SHA.

B.

Store the custom action in a private repository.

Enable all the repositories in the organization to access the action.

Reference the action by using a full-length commit SHA.

C.

Store the custom action in a private repository.

Enable only selected repositories in the organization to access the action.

Reference the action by using a full-length commit SHA.

D.

Store the custom action in a private repository.

Enable only selected repositories in the organization to access the action.

Reference the action by using a semantic version tag.

Full Access
Question # 24

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

A.

Composite action

B.

Bash script action

C.

Docker container action

D.

JavaScript action

Full Access
Question # 25

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.

jobs:build-app:strategy:matrix:node-ver: [10, 12, 14]steps:- uses: actions/setup-node@v3with:node-version: ${{ strategy.node-ver }}

B.

jobs:build-app:strategy:matrix:node-ver: [10, 12, 14]steps:- uses: actions/setup-node@v3with:node-version: ${{ matrix.node-ver }}

C.

jobs:build-app:matrix-strategy:node-ver: [10, 12, 14] steps:- uses: actions/setup-node@v3with:node-version: ${{ matrix-strategy.node-ver }}

D.

jobs:build-app:matrix:strategy:node-ver: [10, 12, 14]steps:- uses: actions/setup-node@v3with:node-version: ${{ matrix.node-ver }}

Full Access
Question # 26

You have a GitHub repository that contains a composite action named Action1 and a workflow named Workflow1. Workflow1 contains the following steps:

• Calls Action1 in a step named report

• Passes count: ' 5 ' by using with

• Reads ${{ steps.report.outputs.summary )}

Action1 completes successfully, but the last step receives an empty value for summary.

You need to ensure that Action1 consumes the input of Workflow1 and exposes the expected output.

How should you complete the metadata file? To answer, select the appropriate options in the answer area.

NOTE: Each correct selection is worth one point.

Full Access
Question # 27

Which workflow command would output the debug message " action successfully debugged " ?

A.

echo :debug::message=action successfully debugged "

B.

echo " debug-action successfully debugged "

C.

echo " ::debug::action successfully debugged "

D.

echo " :debug:action successfully debugged: "

Full Access
Question # 28

What is the most suitable action type for a custom action written in TypeScript?

A.

Bash script action

B.

composite run step

C.

JavaScript action

D.

Docker container action

Full Access
Question # 29

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?

A.

Use service containers with a Postgres database from Docker hub.

B.

Run the actions/postgres action in a parallel job.

C.

It is currently impossible to access the database with GitHub Actions.

D.

Dynamically provision and deprovision an environment.

Full Access
Question # 30

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?

A.

environment variables

B.

workflow commands

C.

self-hosted runners

D.

enable debug loggingE composite run step

Full Access
Question # 31

Which workflow commands send information from the runner? (Choose two.)

A.

reading from environment variables

B.

setting a debug message

C.

populating variables in a Dockerfile

D.

setting output parameters

Full Access
Question # 32

An organization ' s policies specify that only local actions are allowed. How should actions be distributed for this organization?

A.

Via the GitHub Marketplace

B.

Via the .github repository owned by the organization

C.

Via a repository owned by a third party

D.

Via repositories owned by the organization

Full Access
Question # 33

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

A.

the entire workflow, by using env at the top level of the workflow file

B.

all jobs being run on a single Actions runner, by using runner.env at the top of the workflow file

C.

the entire stage, by using env at the top of the defined build stage

D.

within the run attribute of a job step

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

Full Access
Question # 34

In which of the following scenarios should you use self-hosted runners? Each correct answer presents a complete solution.

NOTE: Each correct answer is worth one point.

A.

when the workflow jobs must be run on Windows 10

B.

when jobs must run for longer than 6 hours

C.

when you want to use macOS runners

D.

when GitHub Actions minutes must be used for the workflow runs

E.

when a workflow job needs to install software from the local network

Full Access
Question # 35

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?

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.

Full Access
Question # 36

As a developer, you need to create a custom action written in Python. Which action type should you choose?

A.

Python action

B.

JavaScript action

C.

Docker container action

D.

Composite run step

Full Access
Question # 37

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

A.

Actions > Load workflow

B.

Workflow > New workflow

C.

Workflow > Load workflow

D.

Actions > New workflow

Full Access
Question # 38

Which command can you include in your workflow file to set the output parameter for an action?

A.

echo " action_color=purple " > > $GITHUB_OUTPUT

B.

echo " action_color=purple " > > $GITHUB_ENV

C.

echo " ::add-mask::$ACTION_COLOR "

D.

echo " ::debug::action_color=purple "

Full Access
Question # 39

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.

Full Access
Question # 40

What is the most suitable action type for a custom action written in TypeScript?

A.

Composite run step

B.

Bash script action

C.

JavaScript action

D.

Docker container action

Full Access
Question # 41

Which choices represent best practices for publishing actions so that they can be consumed reliably? (Choose two.)

A.

repo name

B.

tag

C.

commit SHA

D.

organization name

E.

default branch

Full Access
Question # 42

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

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

Full Access
Question # 43

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.

self-hosted runners

B.

actions stored m private repositories in the organization

C.

encrypted secrets

D.

custom Docker actions stored in GitHub Container Registry

E.

actions stored in an organizational partition in the GitHub Marketplace

F.

workflow templates

Full Access
Question # 44

What is the proper syntax to reference the system-provided run number variable?

A.

$GITHUB_RUN_NUMBER

B.

${{ env.GITHUB_RUN_NUMBER }}

C.

${{ var.GITHUB_RUN_NUMBER }}

D.

$github.run_number

E.

${{ GITHUB_RUN_NUMBER }}

Full Access
Question # 45

What will the output be for the following event trigger block in a workflow?

A.

It throws a workflow syntax error, pointing to the types definition in issue_comment event.

B.

It throws a workflow syntax error, pointing to the types definition in issues event.

C.

It runs the workflow when an issue is edited or when an issue comment created.

D.

It runs the workflow when an issue or issue comment in the workflow ' s repository is created or modified.

E.

It runs the workflow when an issue is created or edited, or when an issue or pull request comment is created.

Full Access