Free GH-200 Exam Braindumps
GitHub Actions Questions 36–40 (page: 9)

Updated On: 16-Nov-2026

You have exactly one Windows x64 self-hosted runner, and it is configured with custom tools.
Which syntax could you use in the workflow to target that runner?

  1. runs-on: [self-hosted, windows, x64]
  2. self-hosted: [windows-x64]
  3. runs-on: windows-latest
  4. self-hosted: [windows, x64]

Answer(s): A

Explanation:

Using self-hosted runners in a workflow
To use self-hosted runners in a workflow, you can use labels or groups to specify the runner for a job.
Using default labels to route jobs
A self-hosted runner automatically receives certain labels when it is added to GitHub Actions. These are used to indicate its operating system and hardware platform:
self-hosted: Default label applied to self-hosted runners.
linux, windows, or macOS: Applied depending on operating system.
x64, ARM, or ARM64: Applied depending on hardware architecture.
You can use your workflow's YAML to send jobs to a combination of these labels. In this example, a self-hosted runner that matches all three labels will be eligible to run the job:
runs-on: [self-hosted, linux, ARM64]
self-hosted - Run this job on a self-hosted runner.
linux - Only use a Linux-based runner.
ARM64 - Only use a runner based on ARM64 hardware.


Reference:

https://docs.github.com/en/actions/how-tos/manage-runners/self-hosted-runners/use-in-a-workflow



As a developer, your Actions workflow often reuses the same outputs or downloaded dependencies from one run to another. To cache dependencies for a job, you are using the GitHub cache action.
Which input parameters are required for this action? (Each correct answer presents part of the solution. Choose two.)

  1. path: the file path on the runner to cache or restore
  2. dependency: the name and version of a package to cache or restore
  3. key: the key created when saving a cache and the key used to search for a cache
  4. restore-keys: the copy action key used with cache parameter to cache the data
  5. cache-hit: the copy action key used with restore parameter to restore the data from the cache
  6. ref: the ref name of the branch to access and restore a cache created

Answer(s): A,C

Explanation:

Input parameters for the cache action
[C] key: Required The key created when saving a cache and the key used to search for a cache. It can be any combination of variables, context values, static strings, and functions. Keys have a maximum length of 512 characters, and keys longer than the maximum length will cause the action to fail.
[A] path: Required The path(s) on the runner to cache or restore.
Incorrect:
restore-keys: Optional enableCrossOsArchive: Optional


Reference:

https://docs.github.com/en/actions/reference/workflows-and-actions/dependency-caching



As a developer, you need to use GitHub Actions to deploy a microservice that requires runtime access to a secure token. This token is used by a variety of other microservices managed by different teams in different repos. To minimize management overhead and ensure the token is secure, which mechanisms should you use to store and access the token? (Each correct answer presents a complete solution. Choose two.)

  1. Store the token as a GitHub encrypted secret in the same repo as the code. During deployment, use GitHub Actions to store the secret in an environment variable that can be accessed at runtime.
  2. Use a corporate non-GitHub secret store (e.g., HashiCorp Vault) to store the token. During deployment, use GitHub Actions to store the secret in an environment variable that can be accessed at runtime.
  3. Store the token as an organizational-level encrypted secret in GitHub. During deployment, use GitHub Actions to store the secret in an environment variable that can be accessed at runtime.
  4. Store the token as a GitHub encrypted secret in the same repo as the code. Create a reusable custom GitHub Action to access the token by the microservice at runtime.
  5. Store the token in a configuration file in a private repository. Use GitHub Actions to deploy the configuration file to the runtime environment.

Answer(s): B,C

Explanation:

[B] Using a corporate secret store like HashiCorp Vault provides a secure, centralized location for sensitive information. GitHub Actions can then retrieve and store the token securely during deployment by setting it as an environment variable, ensuring the token remains secure and accessible at runtime.
[C] Storing the token as an organizational-level encrypted secret in GitHub ensures it is accessible across multiple repositories, minimizing management overhead. GitHub Actions can then use this secret during deployment by setting it as an environment variable, allowing the microservice to access it securely at runtime.



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

  1. It makes the action.yml file optional.
  2. It makes it easier for the GitHub community to discover the action.
  3. It widens the scope of the code base for developers fixing issues and extending the action.
  4. It decouples the action’s versioning from the versioning of other application code.
  5. It allows sharing workflow secrets with other users.

Answer(s): B,D

Explanation:

Storing an action in its own repository makes it easier for the GitHub community to discover the action [B], narrows the scope [Not C] of the code base for developers fixing issues and extending the action, and decouples the action's versioning from the versioning of other application code [D].


Reference:

https://docs.github.com/en/actions/how-tos/create-and-publish-actions/manage-custom-actions



As a DevOps engineer, you need to define a deployment workflow that runs after the build workflow has successfully completed. Without modifying the build workflow, which trigger should you define in the deployment workflow?

  1. repository_dispatch
  2. workflow_dispatch
  3. workflow_exec
  4. workflow_run

Answer(s): D

Explanation:

A deployment workflow can be started after a build workflow has finished by using the workflow_run event in the deployment workflow's on trigger. You must specify the name of the build workflow you want to trigger on and use an if condition to ensure the deployment workflow only runs if the build workflow successfully completes.
Here's how to set it up:
1. In your deployment workflow file: (e.g., deploy.yml), define the on: trigger.
2. Use the workflow_run event: within the on: trigger.
3. Specify the build workflow: by its name.
4. Add a conditional if statement: to the workflow to check the conclusion of the workflow_run event, ensuring it equals 'success'.
Example (deploy.yml):
name: Deploy on:
workflow_run:
workflows: ["Build Workflow"] # Replace with the actual name of your build workflow types: [completed]
branches: [ 'main' ] # Optional: Trigger only on the default branch jobs:
deploy:
runs-on: ubuntu-latest if: ${{ github.event.workflow_run.conclusion == 'success' }}
steps:
- name: Deploy to Production run: echo "Deploying..." # Add your actual deployment steps here
Incorrect:
[Not B] workflow_dispatch is used to manually trigger workflows.


Reference:

https://docs.github.com/actions/learn-github-actions/events-that-trigger-workflows



Viewing page 9 of 28
Viewing questions 41 - 45 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!