Weekend Sale Special - 75% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code: newyear

Microsoft GH-200 - GitHub Actions Exam

Page: 1 / 5
Total 137 questions

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 implement the conditional execution of the job?

A.

jobs:

deploy:

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

runs-on: ubuntu-latest

B.

jobs:

deploy:

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

runs-on: ubuntu-latest

C.

jobs:

deploy:

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

runs-on: ubuntu-latest

D.

jobs:

deploy:

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

runs-on: ubuntu-latest

As a developer, you have configured an IP allow list on a GitHub organization. Which effects does the IP allow list have on GitHub Actions?

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

A.

You must allow GitHub Actions ' IP address ranges in order to use Marketplace actions.

B.

You can use standard GitHub-hosted runners since their IP addresses are automatically allowed.

C.

You can use GitHub-hosted larger runners since they can be configured with static IP addresses.

D.

You can use self-hosted runners with known IP addresses.

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

A.

$GITHUB_RUN_NUMBER

B.

${{ env.GITHUB_RUN_NUMBER }}

C.

${{ var.GITHUB_RUN_NUMBER }}

D.

$github.run_number

E.

${{ GITHUB_RUN_NUMBER }}

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?

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

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?

A.

Insights

B.

Code

C.

Actions

D.

Pull requests

E.

Issues

As a DevOps engineer, you are developing a container action. You need to execute a cleanup script after completing the main script execution. Which code block should be used to define the cleanup script?

A.

B.

C.

D.

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?

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}

As a DevOps engineer, you need to execute a deployment to different environments such as development and testing based on labels added to a pull request. The deployment should use the releases branch and trigger only when there is a change in files under the apps folder. Which code block should be used to define the deployment workflow trigger?

A.

on:

pull_request_review:

types: [labeled]

branches:

- ' releases '

paths:

- ' apps/** '

B.

on:

pull_request:

types: [labeled]

branches:

- ' releases/** '

paths:

- ' apps '

C.

on:

pull_request:

types: [labeled]

branches:

- ' releases '

paths:

- ' apps/** '

D.

on:

pull_request_label:

branches:

- ' releases '

paths:

- ' apps/** '

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

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

Which default GitHub environment variable indicates the owner and repository name?

A.

REPOSITORY NAME

B.

GITHUB REPOSITORY

C.

ENV REPOSITORY

D.

GITHUB WORKFLOW REPO