Microsoft GH-200 Practice Test Questions and Exam Dumps Part15 Q281-300

View Full Microsoft GH-200 Exam Dumps and Practice Test Dumps

 

Question 281

Which GitHub feature lets teams combine approved pull requests in a managed queue?

  1. Repository archive
  2. Merge queue
  3. Release draft
  4. Commit comparison

Correct Answer: 2

Explanation:

A merge queue helps teams manage multiple pull requests that are ready to enter a protected branch. Instead of allowing every approved pull request to merge immediately, GitHub can place eligible changes into a queue and validate them in an appropriate sequence. This is particularly useful when several contributions target the same branch and each change needs confirmation against the latest branch state. The queue can help reduce conflicts and prevent a previously passing pull request from becoming invalid because another change merged first. It works alongside branch protection requirements rather than replacing review or status-check requirements.

Question 282

What setting can restrict who is allowed to create forks of repositories within an organization?

  1. Release permissions
  2. Package visibility
  3. Forking policy
  4. Issue assignment

Correct Answer: 4

Explanation:

An organization can control repository forking through its repository and organization policies. Forking policy determines whether members can create forks and, depending on the configuration, where those forks may reside. This control is important for organizations handling proprietary source code because unrestricted forking can create additional copies that require governance. Administrators can establish rules that limit the creation of forks rather than relying solely on repository visibility. Forking controls should be considered together with repository visibility, member permissions, and pull request workflows. These settings help organizations balance collaboration with control over how source code is duplicated.

Question 283

Which GitHub repository visibility allows access to organization members while remaining unavailable publicly?

  1. Internal
  2. Public
  3. Archived
  4. Personal

Correct Answer: 1

Explanation:

An internal repository is designed for sharing source code across members of an organization or enterprise without making that code publicly accessible. It provides a middle ground between public and private repository models. Internal repositories can support collaboration among organizational teams while keeping the project outside public GitHub visibility. Their usefulness is especially apparent in organizations managing many related repositories where employees may need access to shared libraries, templates, or internal tooling. The exact availability of internal repositories depends on the GitHub organizational and enterprise configuration. Repository visibility should therefore be selected according to both collaboration requirements and the organization’s access policies.

Question 284

What does git revert create when undoing an earlier committed change?

  1. A deleted branch
  2. A rewritten repository history
  3. A new commit that reverses the earlier change
  4. A temporary working-tree snapshot

Correct Answer: 3

Explanation:

The git revert operation creates a new commit that applies the inverse of an earlier commit. This makes it useful when a change needs to be undone while preserving the existing commit history. Unlike history-rewriting operations, reverting does not remove the original commit from the repository’s timeline. The new commit documents that the previous change was intentionally reversed. This approach is commonly useful on shared branches because other developers may already have based work on the existing history. The original commit remains visible, while the resulting repository state reflects its reversal.

Question 285

Which release state indicates that a GitHub release is intended for testing before final publication?

  1. Archived
  2. Locked
  3. Internal
  4. Draft

Correct Answer: 4

Explanation:

A draft release is prepared within GitHub but has not yet been published as a normal release. It allows maintainers to assemble release information, upload assets, and review the release details before making it available to users as a published release. Draft releases are useful when teams need time to prepare notes or verify assets without exposing an unfinished release. Once the maintainer is satisfied, the draft can be published. This differs from a published release, which is already visible according to the repository’s release settings. Drafting therefore provides a staging point for release preparation.

Question 286

Which Git feature is designed to store large files outside normal Git object storage?

  1. Git Notes
  2. Git LFS
  3. Git Hooks
  4. Git Attributes

Correct Answer: 2

Explanation:

Git Large File Storage, commonly called Git LFS, is designed for repositories that contain large binary files or other assets that are inefficient to store directly as ordinary Git objects. Instead of keeping the complete large file in the normal repository history, Git LFS stores a lightweight pointer in Git while the actual content is handled through LFS storage. This can help keep repositories more manageable when they contain assets such as media files or large datasets. Git LFS integrates with normal Git workflows while providing specialized handling for files that would otherwise make repository history unnecessarily large.

Question 287

What does a Git submodule primarily provide?

  1. A separate authentication token
  2. A temporary workflow runner
  3. A repository reference nested inside another repository
  4. A replacement for pull requests

Correct Answer: 3

Explanation:

A Git submodule allows one repository to reference another repository at a particular commit. This arrangement can be useful when a project depends on an independently maintained codebase and the consuming project needs to track a specific version of that dependency. The nested repository maintains its own history and lifecycle rather than becoming ordinary files in the parent repository’s history. Teams using submodules need to manage the referenced commit explicitly and ensure contributors initialize and update submodules correctly. Submodules therefore provide a mechanism for connecting repositories while preserving their separate identities and histories.

Question 288

Which Git operation retrieves only a limited portion of repository history to reduce transfer size?

  1. Shallow clone
  2. Full mirror
  3. Repository archive
  4. Branch protection

Correct Answer: 1

Explanation:

A shallow clone retrieves a limited amount of commit history rather than downloading the complete history of a repository. This can significantly reduce the amount of data transferred and can make initial checkout faster, particularly for large repositories or automated build environments. The limitation is that some Git operations requiring older history may not work until additional history is fetched. Shallow cloning is therefore a performance-oriented technique rather than a replacement for a complete repository clone. Teams should choose the depth according to the operations their workflow requires.

Question 289

Which GitHub CLI command displays information about a specific workflow run?

  1. gh run create
  2. gh workflow inspect
  3. gh actions status
  4. gh run view

Correct Answer: 4

Explanation:

The GitHub CLI command gh run view is used to inspect information about a particular GitHub Actions workflow run. It can provide details about the run and its jobs, making it useful when investigating whether an execution succeeded, failed, or produced unexpected results. This command is different from commands that manage workflow definitions themselves. Developers can use the CLI to investigate workflow activity without opening the GitHub web interface for every diagnostic task. When troubleshooting automation, run inspection can help identify the execution that needs closer examination and provide useful context about its outcome.

Question 290

Which GitHub CLI command can manually start a workflow configured for dispatch?

  1. gh workflow launch
  2. gh actions start
  3. gh workflow run
  4. gh run dispatch

Correct Answer: 3

Explanation:

The gh workflow run command can manually trigger a workflow that supports the workflow_dispatch event. It can also be used with supported inputs when the workflow defines them. This is useful for operational workflows that should not execute only because of repository events such as pushes or pull requests. For example, a maintenance or deployment workflow may expose selected parameters and allow an authorized user to start it on demand. The command operates through the GitHub CLI, giving developers and administrators a convenient way to initiate supported workflows from a terminal.

Question 291

Which GitHub Actions variable identifies the number assigned to the current workflow execution?

  1. github.run_number
  2. github.commit_count
  3. github.job_number
  4. github.workflow_index

Correct Answer: 1

Explanation:

The github.run_number context property identifies the sequence number associated with a workflow run. It can be useful when generating human-readable build identifiers, release references, or diagnostic information. The value is associated with executions of the workflow rather than representing a Git commit count. GitHub also exposes other run-related properties, such as the unique run ID and the attempt number, which serve different purposes. Understanding these distinctions helps workflow authors select the correct identifier when constructing logs, artifact names, notifications, or deployment metadata.

Question 292

Which GitHub Actions expression function checks whether a value begins with specified text?

  1. endsWith()
  2. startsWith()
  3. contains()
  4. format()

Correct Answer: 2

Explanation:

The startsWith() expression function checks whether a specified value begins with a particular string. It can be useful when workflow logic depends on naming conventions, branch prefixes, event values, or other structured text. For example, a workflow may use it to recognize branches beginning with a designated prefix. Other expression functions perform different comparisons: endsWith() checks the final characters, contains() checks whether a value includes specified content, and format() constructs formatted strings. Selecting the correct expression function keeps conditional workflow logic precise and easier to understand.

Question 293

Which GitHub Actions context property identifies whether a Git reference is a branch or tag?

  1. github.ref_name
  2. github.ref_path
  3. github.ref_type
  4. github.ref_class

Correct Answer: 3

Explanation:

The github.ref_type context property identifies the type of Git reference associated with the workflow execution. It can indicate whether the reference represents a branch or a tag. This distinction is useful when a workflow behaves differently for branch activity and tag activity. For example, an automation process might perform ordinary validation for branches but package a release when a tag is created. github.ref_name serves a different purpose by identifying the short name of the reference. Understanding the difference between reference type and reference name prevents incorrect conditions in workflows that operate across multiple Git reference types.

Question 294

Which environment file lets a GitHub Actions step add values to later steps’ environment?

  1. GITHUB_ENV
  2. GITHUB_CACHE
  3. GITHUB_CONFIG
  4. GITHUB_RUNTIME

Correct Answer: 1

Explanation:

GITHUB_ENV is an environment file provided by GitHub Actions that allows a step to define environment variables for subsequent steps in the same job. A workflow can write a variable assignment to this file, after which later steps can access the resulting environment value. This mechanism is useful when a workflow calculates information dynamically and needs to make that information available to subsequent commands. The value is not intended to retroactively alter the environment of the step that writes it. Understanding this timing is important when designing multi-step workflows that pass generated configuration between commands.

Question 295

What does GITHUB_PATH allow a GitHub Actions step to modify?

  1. The repository’s Git history
  2. The workflow’s trigger list
  3. The runner’s PATH for later steps
  4. The branch protection configuration

Correct Answer: 3

Explanation:

GITHUB_PATH is an environment file that allows a workflow step to add directories to the system PATH for subsequent steps in the same job. This is useful when a workflow installs a command-line tool into a custom directory and later commands need to execute that tool without specifying its complete path. The modification applies to later steps rather than changing GitHub repository configuration. Because the PATH controls executable lookup, adding a directory through the supported environment-file mechanism provides a convenient way to make dynamically installed tools available throughout the remaining job.

Question 296

Which GitHub Actions context identifies the architecture of the runner executing a job?

  1. runner.platform
  2. runner.arch
  3. runner.machine
  4. runner.cpu_type

Correct Answer: 2

Explanation:

The runner.arch context property identifies the processor architecture of the runner executing the job. This can be useful when workflows need to distinguish between architectures while selecting binaries, build configurations, or platform-specific commands. Runner information is separate from operating-system information, so workflows should use the appropriate context property for each requirement. For example, a build may need to know whether it is running on an ARM-based or x64 environment. Using runner context values allows automation to adapt its behavior without hardcoding assumptions about the machine executing the workflow.

Question 297

Which expression function can intentionally stop a condition from depending on earlier step success?

  1. always()
  2. format()
  3. join()
  4. cancelled()

Correct Answer: 1

Explanation:

The always() status function evaluates to true regardless of whether previous steps have succeeded or failed. It is commonly used when a step must execute for cleanup, reporting, or diagnostic purposes even after an earlier failure. Without an appropriate status condition, GitHub Actions normally skips later steps when earlier steps fail. A workflow author can therefore use always() when the required behavior is independent of the preceding result. It should still be applied thoughtfully, especially to cleanup or critical operations, because running every step after failure may not always be appropriate.

Question 298

Which GitHub Actions status function evaluates to true when a previous step or job has failed?

  1. cancelled()
  2. success()
  3. failure()
  4. completed()

Correct Answer: 3

Explanation:

The failure() status function evaluates to true when a previous step or job has failed, depending on the condition in which it is used. It is useful for failure-specific handling such as collecting diagnostic information, sending an alert, or recording troubleshooting data. This differs from success(), which represents successful completion, and cancelled(), which addresses cancellation. Workflow authors can combine status functions with other expressions to create targeted conditional behavior. Using failure() can help ensure that failure-handling logic executes only when the workflow actually encounters an unsuccessful preceding operation.

Question 299

Which GitHub Actions property uniquely identifies an individual workflow execution?

  1. github.run_id
  2. github.run_name
  3. github.workflow_id
  4. github.execution_key

Correct Answer: 1

Explanation:

The github.run_id property identifies a particular workflow run with a unique identifier. This makes it useful when automation needs to distinguish one execution from another. It differs from github.run_number, which provides a sequence number associated with workflow runs, and from workflow-related naming properties that identify the workflow itself. A unique run identifier can be valuable when creating external references, investigating logs, integrating with deployment systems, or correlating events from different services. Selecting the correct run property helps automation maintain accurate references to individual workflow executions.

Question 300

What does github.ref_name provide during a GitHub Actions run?

  1. The complete repository URL
  2. The runner’s machine name
  3. The short name of the triggering Git reference
  4. The numeric workflow run identifier

Correct Answer: 3

Explanation:

The github.ref_name context property provides the short name of the Git reference associated with the workflow run. Depending on the event, this can represent a branch or tag name without requiring the full reference path. It is useful when scripts need a clean branch or tag value for naming artifacts, selecting deployment targets, or constructing commands. This differs from the complete reference value and from properties that identify the workflow execution itself. Using github.ref_name can simplify workflows that need the human-readable reference name without manually removing the refs/heads/ or refs/tags/ prefix.