Free GH-200 Exam Braindumps
GitHub Actions Questions 31–35 (page: 8)

Updated On: 16-Nov-2026

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

  1. Use artifacts to access the GitHub Package Registry and download a package for a workflow.
  2. Use caching when reusing files that change rarely between jobs or workflow runs.
  3. Use caching to store cache entries for up to 30 days between accesses.
  4. Use artifacts when referencing files produced by a job after a workflow has ended.

Answer(s): B,D

Explanation:

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


Reference:

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

  1. Configure the webhook and network to enable GitHub to trigger workflow.
  2. Create the group custom-software-on-linux and move the runner into the group.
  3. Inform users to identify the runner with the labels custom-software and linux.
  4. Add the label linux to the runner.
  5. Inform users to identify the runner based on the group.
  6. Add the label custom-software to the runner.

Answer(s): C,F

Explanation:

[F] Add a label for the custom software as required.
Note: Using labels with self-hosted runners
You can use labels to organize your self-hosted runners based on their characteristics.
Creating a custom label
You 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.


Reference:

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?

  1. steps:
    - uses: actions/checkout@v3
  2. steps:
    - uses: actions/checkout
  3. steps:
    - uses: actions/checkout@U1673995124
  4. steps:
    - uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c

Answer(s): A

Explanation:

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


Reference:

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 os
4 print(os.environ['PATH'])
5

  1. shell: python
  2. working-directory: .github/python
  3. shell: bash
  4. with: python

Answer(s): A

Explanation:

Workflow syntax for GitHub Actions
Example: Running an inline Python script steps:
- name: Display the path shell: python run: |
import os print(os.environ['PATH'])


Reference:

https://docs.github.com/en/actions/reference/workflows-and-actions/workflow-syntax



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

  1. the entire workflow, by using env at the top level of the workflow file
  2. all jobs being run on a single Actions runner, by using runner.env at the top of the workflow file
  3. the entire stage, by using env at the top of the defined build stage
  4. within the run attribute of a job step
  5. the contents of a job within a workflow, by using jobs.env
  6. a specific step within a job, by using jobs..steps[*].env

Answer(s): A,E,F

Explanation:

Defining environment variables for a single workflow
To 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.


Reference:

https://docs.github.com/en/actions/how-tos/write-workflows/choose-what-workflows-do/use-variables



Viewing page 8 of 28
Viewing questions 36 - 40 out of 134 questions


Post your Comments and Discuss Microsoft GH-200 exam prep with other Community members:

AI Tutor AI Tutor 👋 I’m here to help!