Summer 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 / 10
Total 100 questions

GitHub Actions Exam Questions and Answers

Question 1

Options:

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

Question 2

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 3

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 4

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 5

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 6

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

Options:

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.

Question 7

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 8

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

Options:

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

Question 9

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

Options:

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.

Question 10

Your organization is managing secrets using GitHub encrypted secrets, including a secret named SuperSecret. As a developer, you need to create a version of that secret that contains a different value for use in a workflow that is scoped to a specific repository named MyRepo. How should you store the secret to access your specific version within your workflow?

Options:

A.

Create a duplicate entry for SuperSecret in the encrypted secret store and specify MyRepo as the scope.

B.

Create MyRepo_SuperSecret in GitHub encrypted secrets to specify the scope to MyRepo.

C.

Create a file with the SuperSecret. information in the .qithub/secrets folder in MyRepo.

D.

Create and access SuperSecret from the secrets store in MyRepo.

Question 11

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 12

Which files are required for a Docker container action in addition to the source code? (Choose two.)

Options:

A.

Dockerfile

B.

Actionfile

C.

metadata.yml

D.

action.yml

Question 13

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?

Options:

A.

via the .github repository owned by the organization

B.

via repositories owned by the organization

C.

via the GitHub Marketplace

D.

via a repository owned by a third party

Question 14

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

Question # 14

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 15

You are a DevOps engineer working on deployment workflows. You need to execute the deploy job only if the current branch name is feature-branch. Which code snippet will help you to implement the conditional execution of the job?

Options:

A.

jobs:

deploy:

if: github.ref_name == ' feature-branch '

runs-on: ubuntu-latest

steps:

- uses: actions/checkout@v3

B.

jobs:

deploy:

if: github.ref.name == ' feature-branch '

runs-on: ubuntu-latest

steps:

- uses: actions/checkout@v3

C.

jobs:

deploy:

if: github.branch_name == ' feature-branch '

runs-on: ubuntu-latest

steps:

- uses: actions/checkout@v3

D.

jobs:

deploy:

if: github.branch.name == ' feature-branch '

runs-on: ubuntu-latest

steps:

- uses: actions/checkout@v3

Question 16

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 17

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?

Options:

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.

Question 18

What is the smallest scope for an environment variable?

Options:

A.

the workflow settings

B.

a step

C.

a job

D.

the workflow env mapping

Question 19

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 20

As a developer, you need to make sure that only actions from trusted sources are available for use in your GitHub Enterprise Cloud organization. Which of the following statements are true? (Choose three.)

Options:

A.

Specific actions can individually be enabled for the organization, including version information.

B.

GitHub-verified actions can be collectively enabled for use in the enterprise.

C.

Actions can be restricted to only those available in the enterprise.

D.

Actions created by GitHub are automatically enabled and cannot be disabled.

E.

Individual third-party actions enabled with a specific tag will prevent updated versions of the action from introducing vulnerabilities.

F.

Actions can be published to an internal marketplace.

Question 21

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 22

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

Options:

A.

Set the encrypted secret as a job-level environment variable and then reference the environment variable within the conditional statement.

B.

Create a job dependency that exposes the encrypted secret as a job output, which can then be leveraged in a subsequent dependent job.

C.

Use the secrets context within the conditional statement, e.g. ${{ secrets.MySuperSecret }}.

D.

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.

Question 23

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

Question # 23

Options:

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.

Question 24

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 logging

E composite run step

Question 25

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 26

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 27

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 28

While awaiting approval, how many days can a workflow be in the “Waiting” state before it automatically fails?

Options:

A.

7 days

B.

14 days

C.

30 days

D.

60 days

Question 29

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 30

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

Options:

A.

ENV_ACTOR

B.

GITHUB_WORKFLOW_ACTOR

C.

GITHUB_ACTOR

D.

GITHUB_USER

Page: 1 / 10
Total 100 questions