Summer Sale Special Limited Time 70% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code: xmas50

Microsoft GH-200 - GitHub Actions Exam

Page: 2 / 3
Total 100 questions

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?

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.

You are a DevOps engineer working on a custom action. You want to conditionally run a script at the start of the action, before the main entrypoint. Which code block should be used to define the metadata file for your custom action?

A.

runs:

using: ' node16 '

start: ' start.js '

start-if: github.event_name == ' push '

main: ' index.js '

B.

runs:

using: ' node16 '

pre: ' start.js '

pre-if: github.event_name == ' push '

main: ' index.js '

C.

runs:

using: ' node16 '

pre-if: github.event_name == ' push ' then ' start.js '

main: ' index.js '

D.

runs:

using: ' node16 '

before: ' start.js '

before-if: github.event_name == ' push '

main: ' index.js '

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.

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

In which scenarios could the GITHUB_TOKEN be used? (Choose two.)

A.

to leverage a self-hosted runner

B.

to create a repository secret

C.

to publish to GitHub Packages

D.

to create issues in the repo

E.

to read from the file system on the runner

F.

to add a member to an organization

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

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.

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

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.

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

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.

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.