Pre-Winter Sale Discount Flat 70% Offer - Ends in 0d 00h 00m 00s - Coupon code: 70diswrap

Microsoft GH-200 Dumps

Page: 1 / 14
Total 137 questions

GitHub Actions Exam Questions and Answers

Question 1

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?

Options:

A.

Insights

B.

Code

C.

Actions

D.

Pull requests

E.

Issues

Question 2

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

Options:

A.

reading from environment variables

B.

setting a debug message

C.

populating variables in a Dockerfile

D.

setting output parameters

Question 3

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 4

As a developer, what is the safest way to reference an action to prevent modification of the underlying code?

Options:

A.

Use a commit hash.

B.

Use a branch name.

C.

Use a patch release tag.

D.

Use a major release tag.

Question 5

As a developer, you want to run a workflow from the Actions tab in GitHub. Which YAML snippet should you use to match the interface in this image?

as

A)

as

B)

as

C)

D)as

as

Options:

A.

Option A

B.

Option B

C.

Option C

D.

Option D

Question 6

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

Options:

A.

repo name

B.

tag

C.

commit SHA

D.

organization name

E.

default branch

Question 7

As a developer, you created a JavaScript action. What is the best way to test your JavaScript action?

Options:

A.

Package your JavaScript action inside a Docker container image and run it.

B.

Create a workflow that only executes your specific JavaScript action.

C.

Create a workflow that includes the actions/debug-javascript action.

D.

Use a tool called @vercel/ncc to compile your code.

Question 8

Custom environment variables can be defined at multiple levels within a workflow file, including which three levels?

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

Options:

A.

Stage level

B.

Default level

C.

Step level

D.

Runner level

E.

Top level

F.

Job level

Question 9

Which workflow event is used to manually trigger a workflow run?

Options:

A.

create

B.

workflow_dispatch

C.

workflow_run

D.

status

Question 10

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

Options:

A.

Python action

B.

JavaScript action

C.

Docker container action

D.

Composite run step

Question 11

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

Options:

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.

Question 12

You create a self-hosted runner labeled as runner1.

You need to ensure that a GitHub Actions workflow job runs only on runner1.

Which YAML statement should you use?

Options:

A.

runs-on: [self-hosted, linux-xlarge]

B.

runs-on: - self-hosted - ubuntu-latest

C.

runs-on: [self-hosted, runner1]

D.

runs-on: self-hosted

Question 13

Which choices represent best practices for publishing actions so that they can be consumed reliably?

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

Options:

A.

Organization name

B.

Commit SHA

C.

Repository name

D.

Tag

E.

Default branch

Question 14

As a developer, you are optimizing a GitHub workflow that uses and produces many different files. You need to determine when to use caching versus workflow artifacts. Which two statements are true? (Choose two.)

Options:

A.

Use caching when reusing files that change rarely between jobs or workflow runs.

B.

Use artifacts when referencing files produced by a job after a workflow has ended.

C.

Use caching to store cache entries for up to 30 days between accesses.

D.

Use artifacts to access the GitHub Package Registry and download a package for a workflow

Question 15

As a developer, which workflow steps should you perform to publish an image to the GitHub Container Registry? (Choose three.)

Options:

A.

Use the actions/setup-docker action

B.

Authenticate to the GitHub Container Registry.

C.

Build the container image.

D.

Push the image to the GitHub Container Registry

E.

Pull the image from the GitHub Container Registry.

Question 16

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.

NOTE: Each correct answer is worth one point.

4 name: Node CI/CD

5

6

7

8 jobs:

9 build:

10 runs-on:

11 steps:

12 - uses: actions/checkout@v2

13 - uses: actions/setup-node@v1

14 with:

15 node-version: 12

16 - run: npm ci

17 - run: npm test

18

Options:

A.

on:env:- ' prod ' - ' qa ' - ' test '

B.

on: [push, commit]

C.

on: [push, pull_request]

D.

on:branches:- ' main ' - ' dev '

E.

on:push:branches:- mainrelease:types:- created

F.

on:schedule:- cron: ' */15 * * * * ' initiate:- ' main '

Question 17

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 18

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 19

You need to make a script to retrieve workflow run logs by using the API. Which is the correct API endpoint to download a workflow run log?

Options:

A.

GET /repos/{owner}/{repo}/actions/runs/{run_id}/logs

B.

POST /repos/{owner}/{repo}/actions/runs/{run_id}/logs

C.

GET /repos/{owner}/{repo}/actions/artifacts/logs

D.

POST /repos/{owner}/{repo}/actions/runs/{run_id}

Question 20

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 21

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 22

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 23

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?

Options:

A.

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

B.

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

C.

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

D.

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

Question 24

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

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

Options:

A.

JavaScript action

B.

composite run step

C.

Python action

D.

Docker container action

Question 25

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.

Options:

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.

Question 26

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 27

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

Options:

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: "

Question 28

What is the most secure way to store sensitive information in GitHub Actions workflows?

Options:

A.

Use environment variables in the workflow and store sensitive data directly in the variables.

B.

From the GitHub repository settings, store sensitive data as unencrypted text.

C.

Store the sensitive information as plain text in the workflow YAML file.

D.

Use GitHub Enterprise Managed User (OIDC) integration to dynamically fetch secrets from a third-party secrets manager.

Question 29

As a developer, one of your workflows requires Xcode version 11.2 hosted on macOS Catalina (version 10.15). You have 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 correct answer presents part of the solution. Choose three.)

Options:

A.

Create runner groups named macos-10.15 and xcode-11.2.

B.

In the workflow, specify:

runs-on: [${{ groups.macos-10.15 }}, ${{ groups.xcode-11.2 }}]

C.

Assign the custom labels to the self-hosted runner.

D.

Create custom runner labels for macos-10.15 and xcode-11.2.

E.

Add your runner to the appropriate runner groups.

F.

In the workflow, specify:

runs-on: [self-hosted, macos-10.15, xcode-11.2]

Question 30

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?

Options:

A.

There is a different value specified at the rego level.

B.

There is a different value specified at the workflow level.

C.

The Codespace secret doesn ' t match the expected value.

D.

The Encrypt Secret setting was not configured for the secret.

E.

There is a different value specified at the enterprise level.

Question 31

As a developer, your self-hosted runner sometimes loses its connection while running jobs. How should you troubleshoot the issue affecting your self-hosted runner?

Options:

A.

Access the self-hosted runner ' s installation directory and look for log files in the _diag folder.

B.

Locate the self-hosted runner in your repository ' s settings page and download its log archive.

C.

Start the self-hosted runner with the --debug flag to produce more verbose console output.

D.

Set the DEBUG environment variable to true before starting the self-hosted runner.

Question 32

As a DevOps engineer, you need to define a deployment workflow that runs after the build workflow has successfully completed. Without modifying the build workflow, which trigger should you define in the deployment workflow?

Options:

A.

repository_dispatch

B.

workflow_run

C.

workflow_exec

D.

workflow_dispatch

Question 33

You need to trigger a workflow using the GitHub API for activity that happens outside of GitHub. Which workflow event do you use?

Options:

A.

check_suite

B.

workflow_run

C.

deployment

D.

repository_dispatch

Question 34

When reviewing an action for use, what file defines its available inputs and outputs?

Options:

A.

inputs.yml

B.

config.json

C.

defaults.json

D.

workflow.yml

E.

action.yml

Question 35

What can be used to set a failed status of an action from its code?

Options:

A.

@actions/github toolkit

B.

JavaScript dist/ folder

C.

Dockerfile CMD

D.

a non-zero exit code

E.

output variable

F.

composite run step

Question 36

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

Options:

A.

The action.yml metadata file references a package.json file.

B.

The action ' s repository includes a js.yml file in the .github/workflows directory.

C.

The action’s repository name includes the keyword “JavaScript.”

D.

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

Question 37

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 38

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

Options:

A.

$GITHUB_RUN_NUMBER

B.

${{ env.GITHUB_RUN_NUMBER }}

C.

${{ var.GITHUB_RUN_NUMBER }}

D.

$github.run_number

E.

${{ GITHUB_RUN_NUMBER }}

Question 39

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 40

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 41

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

Options:

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 "

Page: 1 / 14
Total 137 questions