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? (Each correct answer presents part of the solution. Choose two.)
Answer(s): B,D
[B] Use caching when you want to reuse files that don't change often between jobs or workflow runs, such as build dependencies from a package management system.[D] Use artifacts when you want to save files produced by a job to view after a workflow run has ended, such as built binaries or build logs.
https://docs.github.com/en/enterprise-server@3.16/actions/tutorials/store-and-share-data
You installed specific software on a Linux self-hosted runner. You have users with workflows that need to be able to select the runner based on the identified custom software. Which steps should you perform to prepare the runner and your users to run these workflows? (Each correct answer presents part of the solution. Choose two.)
Answer(s): C,F
[F] Add a label for the custom software as required.Note: Using labels with self-hosted runnersYou can use labels to organize your self-hosted runners based on their characteristics.Creating a custom labelYou can create custom labels for runners at the repository and organization levels.[C, not D] Linux is a default label and does not have to be created to be used.
https://docs.github.com/en/actions/how-tos/manage-runners/self-hosted-runners/apply-labels
Which of the following is the most common way to target a specific major release version?
Answer(s): A
Example: Using versioned actions steps:# Reference a specific commit- uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3*-> # Reference the major version of a release- uses: actions/checkout@v4# Reference a specific version- uses: actions/checkout@v4.2.0# Reference a branch- uses: actions/checkout@main
https://docs.github.com/en/actions/reference/workflows-and-actions/workflow-syntax
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 os4 print(os.environ['PATH'])5
Workflow syntax for GitHub ActionsExample: Running an inline Python script steps:- name: Display the path shell: python run: |import os print(os.environ['PATH'])
Which scopes are available to define custom environment variables within a workflow file? (Choose three.)
Answer(s): A,E,F
Defining environment variables for a single workflowTo set a custom environment variable for a single workflow, you can define it using the env key in the workflow file. The scope of a custom variable set by this method is limited to the element in which it is defined. You can define variables that are scoped for:[A] The entire workflow, by using env at the top level of the workflow file.[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.
https://docs.github.com/en/actions/how-tos/write-workflows/choose-what-workflows-do/use-variables
Post your Comments and Discuss Microsoft GH-200 exam prep with other Community members:
Our website is free, but we have to fight against AI bots and content theft. We're sorry for the inconvenience caused by these security measures. You can access the rest of the GH-200 content, but please register or login to continue.