Free GH-200 Exam Braindumps
GitHub Actions Questions 11–15 (page: 4)

Updated On: 16-Nov-2026

As a developer, you are using a Docker container action in your workflow.
What is required for the action to run successfully?

  1. The job env must be set to a Linux environment.
  2. The action must be published to the GitHub Marketplace.
  3. The referenced action must be hosted on Docker Hub.
  4. The job runs-on must specify a Linux machine with Docker installed.

Answer(s): D

Explanation:

To run a Docker container action, the job's runs-on environment must be a Linux machine that has Docker installed.
Key Requirements
Linux OS Only: Docker container actions are only supported on Linux runners. They cannot run on Windows or macOS runners.
Docker Installed: The runner must have the Docker CLI and daemon installed and running to build and execute the action's container.
GitHub-Hosted Runners: If you use GitHub-hosted runners, you must specify an Ubuntu environment (e.g., runs-on: ubuntu-latest), as these come pre-configured with Docker.
Self-Hosted Runners: For self-hosted runners, you must manually ensure the machine is running Linux and has Docker installed.


Reference:

https://docs.github.com/actions/sharing-automations/creating-actions/creating-a-docker-container-action



As a developer, you need to add the correct syntax to allow the following workflow file to be triggered by multiple types of events.
Which two code blocks should you add starting at line 5? (Each correct answer presents a complete solution. Choose two.)

  1. on: [push, pull_request]
  2. on:
    branches:
    - 'main'
    - 'dev'
  3. on:
    schedule:
    - cron: '*/15 * * * *'
    initiate:
    - 'main'
  4. on: [push, commit]
  5. on:
    push:
    branches:
    - main release:
    types:
    - created
  6. on:
    env:
    - 'prod'
    - 'qa'
    - 'test'

Answer(s): A,E



You need to trigger a workflow using the GitHub API for activity that happens outside of GitHub.
Which workflow event do you use?

  1. workflow_run
  2. deployment
  3. check_suite
  4. repository_dispatch

Answer(s): D

Explanation:

You can use the GitHub API to trigger a webhook event called repository_dispatch when you want to trigger a workflow for activity that happens outside of GitHub .


Reference:

https://docs.github.com/en/actions/reference/workflows-and-actions/events-that-trigger-workflows



You are a DevOps engineer working on a custom action. You want to conditionally run a script at the start of the action, before the main entrypoint.
Which code block should be used to define the metadata file for your custom action?

  1. runs:
    using: 'nodel6'
    pre-if: github.event_name == 'push' then 'start.js'
    main: 'index.js'
  2. runs:
    using: 'nodel6'
    pre: 'start.js'
    pre-if: github.event_name == 'push'
    main: 'index.js'
  3. runs:
    using: 'nodel6'
    start: 'start.js'
    start-if: github.event_name == 'push'
    main: 'index.js'
  4. runs:
    using: 'nodel6'
    before: 'start.js'
    before-if: github.event_name == 'push'
    main: 'index.js’

Answer(s): B

Explanation:

The pre: line before the pre-if: line.
Note: runs.pre-if
Optional
Allows you to define conditions for the pre: action execution. The pre: action will only run if the conditions in pre-if are met. If not set, then pre-if defaults to always(). In pre-if, status check functions evaluate against the job's status, not the action's own status.
Note that the step context is unavailable, as no steps have run yet.
In this example, cleanup.js only runs on Linux-based runners:
pre: 'cleanup.js'
pre-if: runner.os == 'linux'


Reference:

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



As a developer, one of your workflows will require XCode version 11.2 hosted on macOS Catalina (i.e., v10.15). You’ve already created and configured a self-hosted runner to conform to those requirements and registered it with your organization.
What else should you do to ensure that the workflow accesses the correct runner instance? (Each answer presents a complete solution. Choose three.)

  1. Add your runner to the appropriate runner groups.
  2. In the workflow, specify:
    runs-on: [ ${{groups.macos-10.15}}, ${{groups.xcode-11.2}} ].
  3. Create custom runner labels for macos-10.15 and xcode-11.2.
  4. Create runner groups named macos-10.15 and xcode-11.2.
  5. In the workflow, specify:
    runs-on: [self-hosted, macos-10.15, xcode-11.2].
  6. Assign the custom labels to the self-hosted runner.

Answer(s): C,E,F

Explanation:

[C, F] Using custom labels to route jobs
You can create custom labels and assign them to your self-hosted runners at any time. Custom labels let you send jobs to particular types of self-hosted runners, based on how they're labeled.
[E] 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



Viewing page 4 of 28
Viewing questions 16 - 20 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!