Black Friday Rush: 75% Off All Exam Bundles! Apply the coupon code below before the offer expires! - Ends in 0d 00h 00m 00s - Coupon code: newyear

Microsoft GH-200 - GitHub Actions Exam

Page: 4 / 5
Total 150 questions

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

A.

with: python

B.

shell: bash

C.

working-directory: .github/python

D.

shell: python

What are two reasons to keep an action in its own repository instead of bundling it with other application code?

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

A.

It makes it easier for the GitHub community to discover the action.

B.

It decouples the action ' s versioning from the versioning of other application code.

C.

It allows sharing workflow secrets with other users.

D.

It widens the scope of the code base for developers fixing issues and extending the action.

E.

It makes the action.yml file optional.

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

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.

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

A.

Dockerfile

B.

Actionfile

C.

metadata.yml

D.

action.yml

Which step is using the dbserver environment variable correctly?

A.

steps: - name: Hello world run: echo $dbserver variables: dbserver: orgserver1

B.

steps: - name: Hello world run: echo $dbserver env: dbserver: orgserver1

C.

steps: - name: Hello world run: echo $dbserver env: - name: dbserver value: orgserver1

D.

steps: - name: Hello world run: echo $dbserver environment: dbserver: orgserver1

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.

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

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.

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.