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

Microsoft GH-200 Dumps

Page: 1 / 10
Total 100 questions

GitHub Actions Exam Questions and Answers

Question 1

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 2

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

as

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 3

You need to create new workflows to deploy to an unfamiliar cloud provider. What is the fastest and safest way to begin?

Options:

A.

Create a custom action to wrap the cloud provider ' s CLI.

B.

Search GitHub Marketplace for verified actions published by the cloud provider.

C.

Use the actions/jenkins-plugin action to utilize an existing Jenkins plugin for the cloud provider.

D.

Search GitHub Marketplace for actions created by GitHub.

E.

Download the CLI for the cloud provider and review the associated documentation.

Question 4

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 5

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 6

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 7

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 8

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 9

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 10

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? (Choose two.)

Options:

A.

Store the token in a configuration file in a private repository. Use GitHub Actions to deploy the configuration file to the runtime environment.

B.

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.

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

E.

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.

Question 11

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 12

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 13

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

Question 14

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.

Options:

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.

Question 15

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 16

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 17

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 18

Which of the following scenarios requires a developer to explicitly use the GITHUB_TOKEN or github.token secret within a workflow? (Choose two.)

Options:

A.

passing the GITHUB_TOKEN secret to an action that requires a token as an input

B.

making an authenticated GitHub API request

C.

checking out source code with the actions/checkout@v3 action

D.

assigning non-default permissions to the GITHUB_TOKEN

Question 19

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

Options:

A.

POST /repos/:owner/:repo/actions/runs/:run_id

B.

GET /repos/:owner/:repo/actions/artifacts/logs

C.

GET /repos/:owner/:repo/actions/runs/:run_id/logs

D.

POST /repos/:owner/:repo/actions/runs/:run_id/logs

Question 20

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 21

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 22

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

directory: ${{ inputs.dir }}

shell: bash

B.

runs:

using: " composite "

directory: ${{ inputs.dir }}

steps:

- run: $GITHUB_ACTION_PATH/script.sh

shell: bash

C.

runs:

using: " composite "

working-directory: ${{ inputs.dir }}

steps:

- run: $GITHUB_ACTION_PATH/script.sh

shell: bash

D.

runs:

using: " composite "

steps:

- run: $GITHUB_ACTION_PATH/script.sh

working-directory: ${{ inputs.dir }}

shell: bash

Question 23

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 24

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

Options:

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

Question 25

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 26

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 27

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

Options:

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

Question 28

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 29

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 30

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

Page: 1 / 10
Total 100 questions