Microsoft GitHub Actions GH-200 Dumps in PDF

Free Microsoft GH-200 Real Questions (page: 18)

Which of the following statements are true regarding the use of GitHub Actions on a GitHub Enterprise Server instance? (Each correct answer presents a complete solution. Choose three.)

  1. Actions created by GitHub are automatically available and cannot be disabled.
  2. Third-party actions can be used on GitHub Enterprise Server by configuring GitHub Connect.
  3. Most GitHub-authored actions are automatically bundled for use on GitHub Enterprise Server.
  4. Use of GitHub Actions on GitHub Enterprise Server requires a persistent internet connection.
  5. Actions must be defined in the .github repository.
  6. Third-party actions can be manually synchronized for use on GitHub Enterprise Server.

Answer(s): B,C,F

Explanation:

[B] If you want your GitHub Enterprise Server instance to use third-party custom actions, you need to enable GitHub Connect.
[C] Most official GitHub-authored actions are automatically bundled with GitHub Enterprise Server, and are captured at a point in time from GitHub Marketplace.
[F] Third-party actions can be manually synchronized to GitHub Enterprise Server (GHES) to be used in workflows without requiring an internet connection to GitHub.com. This is done using the actions-sync tool to download actions from GitHub.com and transfer them to the GHES instance. This manual method provides an alternative to using GitHub Connect, offering stricter control over which actions are available on the GHES instance.
Incorrect:
[Not D] There is no connection required between your GitHub Enterprise Server instance and GitHub.com to use these actions.


Reference:

https://docs.github.com/en/enterprise-server@3.17/get-started/exploring-integrations/about-using-integrations https://docs.github.com/en/enterprise-server@3.17/admin/managing-github-actions-for-your-enterprise/managi ng-access-to-actions-from-githubcom/about-using-actions-in-your-enterprise



You need to use a specific version of an action. How should you use v1 of an actions/javascript-action repository in your workflow?





Answer(s): D

Explanation:

The appropriate code to use version v1 of the actions/javascript-action repository in your GitHub Actions workflow is uses: actions/javascript-action@v1.
Workflow Implementation
You implement this code within a specific step under a job in your workflow YAML file (located in .github/workflows/):
jobs:
my_job:
runs-on: ubuntu-latest steps:
- name: Run JavaScript Action uses: actions/javascript-action@v1


Reference:

https://docs.github.com/en/organizations/managing-organization-settings/disabling-or-limiting-github-actions-fo r-your-organization



What is a role of GitHub Marketplace when using GitHub Actions workflows?

  1. GitHub Marketplace is used to manage secrets and environment variables for workflows.
  2. GitHub Marketplace enables users to publish their own workflows and discover workflows created by others.
  3. GitHub Marketplace provides a platform for hosting private workflows shared only within an organization.
  4. GitHub Marketplace is used to run workflows on a specified schedule.

Answer(s): B

Explanation:

The GitHub Marketplace is primarily a platform for finding and sharing public actions, apps, and workflows with the entire GitHub community.
Incorrect:
[Not C]
The GitHub Marketplace is primarily a platform for finding and sharing public actions, apps, and workflows with the entire GitHub community. It is not the native platform for hosting workflows that are shared privately within an organization.
How to Share Workflows Privately
Rather than using the Marketplace, you can manage internal sharing through these methods:
Internal Repositories: You can store reusable workflows or actions in an internal repository. This makes them visible and usable by any other repository within the same organization or enterprise without making them public.
Private Repository Access: You can configure a private repository to allow access from other specific repositories or all repositories within your organization.
Reusable Workflows: By defining a workflow with the on: workflow_call trigger, you can reference it from other repositories using the owner/repo/path/to/workflow.yml@ref syntax.
Organizational Policies: Administrators can set policies at the organization or enterprise level to allow only internal actions, or a specific "allow list" of verified Marketplace actions.


Reference:

https://www.geeksforgeeks.org/git/what-is-github-marketplace/



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

  1. ${{var.GITHUB_RUN_NUMBER}}
  2. ${{env.GITHUB_RUN_NUMBER}}
  3. $GITHUB_RUN_NUMBER
  4. ${{GITHUB_RUN_NUMBER}}
  5. $github.run_number

Answer(s): D

Explanation:

Default environment variables
The default environment variables that GitHub sets are available to every step in a workflow.
Because default environment variables are set by GitHub and not defined in a workflow, they are not accessible through the env context [Not B]. However, most of the default variables have a corresponding, and similarly named, context property. For example, the value of the GITHUB_REF variable can be read during workflow processing using the ${{ github.ref }} context property.


Reference:

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



Which workflow event is used to manually trigger a workflow run?

  1. status
  2. workflow_dispatch
  3. workflow_run
  4. create

Answer(s): B

Explanation:

Manually running a workflow
When a workflow is configured to run on the workflow_dispatch event, you can run the workflow using the Actions tab on GitHub, GitHub CLI, or the REST API.
Configuring a workflow to run manually
To run a workflow manually, the workflow must be configured to run on the workflow_dispatch event.
To trigger the workflow_dispatch event, your workflow must be in the default branch.


Reference:

https://docs.github.com/en/actions/how-tos/manage-workflow-runs/manually-run-a-workflow



Which choices represent best practices for publishing actions so that they can be consumed reliably? (Each correct answer presents a complete solution. Choose two.)

  1. default branch
  2. commit SHA
  3. repo name
  4. tag
  5. organization name

Answer(s): B,D

Explanation:

Security practices for writing workflows and using GitHub Actions features.
You can help mitigate this risk by following these good practices:
[B] Pin actions to a full-length commit SHA
Pinning an action to a full-length commit SHA is currently the only way to use an action as an immutable release. Pinning to a particular SHA helps mitigate the risk of a bad actor adding a backdoor to the action's repository, as they would need to generate a SHA-1 collision for a valid Git object payload.
When selecting a SHA, you should verify it is from the action's repository and not a repository fork.
[D] Pin actions to a tag only if you trust the creator
Although pinning to a commit SHA is the most secure option, specifying a tag is more convenient and is widely used. If you’d like to specify a tag, then be sure that you trust the action's creators. The ‘Verified creator’ badge on GitHub Marketplace is a useful signal, as it indicates that the action was written by a team whose identity has been verified by GitHub. Note that there is risk to this approach even if you trust the author, because a tag can be moved or deleted if a bad actor gains access to the repository storing the action.


Reference:

https://docs.github.com/en/actions/reference/security/secure-use



As a developer, you need to integrate a GitHub Actions workflow with a third-party code quality provider that uses the Checks API. How should you trigger a follow-up workflow?

  1. Add the workflow_run webhook event as a trigger for the workflow for the code quality integration name
  2. Add the check_run webhook event as a trigger for the workflow when the code quality integration is completed
  3. Add the pull_request webhook event as a trigger for the workflow when the code quality integration is synchronized
  4. Add the deployment webhook event as a trigger for the workflow when the code quality integration is completed

Answer(s): B

Explanation:

The check_run event is triggered when a check (such as a code quality check) completes, including when the status of a check changes. By adding this event as a trigger, you can initiate a follow-up workflow when the code quality integration finishes its checks.


Reference:

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



Which statement accurately describes using labels to route GitHub Actions workflows to runners?

  1. A user can assign multiple labels to a self-hosted runner and use the labels in a runs-on to target only runners that match all the specified labels.
  2. Labels apply only to GitHub-hosted runners and are ignored by self-hosted runners.
  3. GitHub Actions automatically assigns the runner's IP address as a label, and the label must be used in a runs-on.
  4. To target a specific runner, the runs-on must match the runner's hostname rather than its labels.

Answer(s): A

Explanation:

GitHub Actions routes jobs to specific runners by matching the labels defined in the workflow's runs-on key with the labels assigned to available runners. For a job to be assigned to a runner, that runner must possess all of the labels specified in the workflow's routing array
Standard Label Matching Logic
When you write a job, you define a target list of labels using the runs-on keyword.
jobs:
build:
runs-on: [self-hosted, linux, gpu]
steps:
- run: echo "Running a GPU intensive task on Linux!"
For this job to clear the queue, GitHub searches for an active runner where:
It has the label self-hosted AND
It has the label linux AND
It has the label gpu
If a runner only has [self-hosted, linux], it will be ignored. The runner can possess extra labels not requested by the workflow, but it must strictly contain at least the exact subset you specified.


Reference:

https://docs.github.com/enterprise-cloud@latest/actions/hosting-your-own-runners/managing-self-hosted-runn ers/using-self-hosted-runners-in-a-workflow



Share your comments for Microsoft GH-200 exam with other users:

A
AI Tutor Explanation
5/10/2026 12:51:57 AM

Which statement is true about using default environment variables? The environment variables can be read in workflows using the ENV: variable_name syntax. The environment variables created should be prefixed with GITHUB_ to ensure they can be accessed in workflows The environment variables can be set in the defaults: sections of the workflow The GITHUB_WORKSPACE environment variable should be used to access files from within the runner.
Correct answer: The statement "The GITHUB_WORKSPACE environment variable should be used to access files from within the runner." is true.
Why the others are false:

  • ENV: variable_name syntax is not how you read env vars in workflows. Use ${{ env.VARIABLE }} in expressions or $VARIABLE in a shell.
  • Environment variables don’t need a GITHUB_ prefix. Custom vars can have any name; GITHUB_ is only for built-in, predefined vars.
  • defaults: cannot set environment variables. It configures defaults for run steps (like shell or working-directory), not env vars.

Extra tip:
  • GITHUB_WORKSPACE (or ${{ github.workspace }}) is the root path on the runner where the repository is checked out. Use it to access files, e.g., $GITHUB_WORKSPACE/... or ${{ github.workspace }}/....

AI Tutor 👋 I’m here to help!