[Sep 11, 2025] Valid GH-200 Test Answers Full-length Practice Certification Exams [Q11-Q31]

Share

[Sep 11, 2025] Valid GH-200 Test Answers Full-length Practice Certification Exams

Accurate & Verified 2025 New GH-200 Answers As Experienced in the Actual Test!

NEW QUESTION # 11
How can GitHub Actions encrypted secrets be used in if: conditionals within a workflow job?

  • A. Set the encrypted secret as a job-level environment variable and then reference the environment variable within the conditional statement.
  • B. Use a workflow command to expose the encrypted secret via a step's output parameter and then use the step output in the job's if: conditional.
  • C. Use the secrets context within the conditional statement, e.g. ${{ secrets.MySuperSecret }}.
  • D. Create a job dependency that exposes the encrypted secret as a job output, which can then be leveraged in a subsequent dependent job.

Answer: C

Explanation:
GitHub Actions encrypted secrets can be accessed in workflows using the secrets context. You can directly reference the secret within an if: conditional using ${{ secrets.MySuperSecret }} to determine whether a job or step should run based on the secret's value.


NEW QUESTION # 12
You are reaching your organization's storage limit for GitHub artifacts and packages. What should you do to prevent the storage limit from being reached?

  • A. via repositories owned by the organization
  • B. via the GitHub Marketplace
  • C. via the .github repository owned by the organization
  • D. via a repository owned by a third party

Answer: A

Explanation:
To prevent reaching the storage limit for GitHub artifacts and packages, you should manage and clean up artifacts and packages stored in repositories owned by your organization. This includes deleting unnecessary artifacts and managing the lifecycle of packages, as they contribute directly to your organization's storage quota.


NEW QUESTION # 13
In which scenarios could the GITHUB_TOKEN be used? (Choose two.)

  • A. to add a member to an organization
  • B. to read from the file system on the runner
  • C. to publish to GitHub Packages
  • D. to leverage a self-hosted runner
  • E. to create issues in the repo
  • F. to create a repository secret

Answer: C,E

Explanation:
The GITHUB_TOKEN is automatically provided by GitHub in workflows and can be used to authenticate API requests to GitHub, including publishing packages to GitHub Packages.
The GITHUB_TOKEN is also used to authenticate API requests for actions like creating issues, commenting, or interacting with pull requests within the same repository.


NEW QUESTION # 14
What is the minimal syntax for declaring an output named foo for an action?

  • A.
  • B.
  • C.
  • D.

Answer: D

Explanation:
The correct minimal syntax for declaring an output in GitHub Actions is by using the foo key under outputs, and associating it with a value (in this case, Some value). This is the simplest form to define an output in a workflow or action.


NEW QUESTION # 15
Based on the YAML below, which two statements are correct? (Choose two.)

  • A. This workflow will publish a package to an npm registry.
  • B. This workflow will publish a package to GitHub Packages.
  • C. This workflow file is using a matrix strategy.
  • D. The workflow job publish-npm will only run after the build job passes.

Answer: A,D

Explanation:
The publish-npm job includes the JS-DevTools/npm-publish action, which is used to publish an npm package to an npm registry.
The publish-npm job has the needs: build directive, meaning it will only run after the build job successfully completes.


NEW QUESTION # 16
GitHub-hosted runners support which capabilities? (Choose two.)

  • A. support for a variety of Linux variations including CentOS, Fedora, and Debian
  • B. requiring a payment mechanism (e.g., credit card) to use for private repositories
  • C. automatic file-system caching between workflow runs
  • D. automatic patching of both the runner and the underlying OS
  • E. support for Linux, Windows, and mac

Answer: A,E

Explanation:
GitHub-hosted runners automatically handle patching, meaning they will be kept up to date with the latest security updates and software patches for both the runner environment and the underlying operating system.
GitHub-hosted runners support Linux, Windows, and macOS, giving you flexibility to run workflows on different operating systems without needing to manage your own self-hosted runners.


NEW QUESTION # 17
Disabling a workflow allows you to stop a workflow from being triggered without having to delete the file from the repo. In which scenarios would temporarily disabling a workflow be most useful? (Choose two.)

  • A. A workflow is configured to run on self-hosted runners
  • B. A runner needs to have diagnostic logging enabled.
  • C. A workflow sends requests to a service that is down.
  • D. A workflow needs to be changed from running on a schedule to a manual trigger
  • E. A workflow error produces too many, or wrong, requests, impacting external services negatively.

Answer: C,E

Explanation:
If a workflow depends on an external service that is down, disabling the workflow temporarily will prevent it from running and sending requests to the service, thus avoiding failed requests or unnecessary retries.
If a workflow is causing a negative impact on external services by generating too many requests or incorrect data due to a bug, temporarily disabling the workflow will stop this behavior while the issue is fixed.


NEW QUESTION # 18
What are the two ways to pass data between jobs? (Choose two.)

  • A. Use the copy action with cache parameter to cache the data
  • B. Use job outputs
  • C. Use data storage.
  • D. Use artifact storage.
  • E. Use the copy action with restore parameter to restore the data from the cache
  • F. Use the copy action to save the data that should be passed in the artifacts folder.

Answer: B,D

Explanation:
Job outputs are used to pass data from one job to another in a workflow. A job can produce output values (like variables or files), which can be referenced by subsequent jobs using the needs keyword and ${{ steps.step_id.outputs.output_name }} syntax.
Artifact storage allows data (such as files or results) to be saved by a job and then retrieved by another job in a later step. This is commonly used for passing large amounts of data or files between jobs.


NEW QUESTION # 19
What are the two types of environment protection rules you can configure? (Choose two.)

  • A. required reviewers
  • B. artifact storage
  • C. wait timer
  • D. branch protections

Answer: A,C

Explanation:
Required reviewers is a protection rule where you can specify that certain individuals or teams must review and approve the workflow run before it can proceed. This is used to enforce approvals before certain steps or environments are accessed.
Wait timer is a protection rule that introduces a delay before a workflow can proceed to the next stage. This is useful for adding time-based constraints to the deployment process or ensuring that certain conditions are met before a workflow continues.


NEW QUESTION # 20
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? (Choose two.)

  • A. restore-keys: the copy action key used with cache parameter to cache the data
  • B. cache-hit: the copy action key used with restore parameter to restore the data from the cache
  • C. key: the key created when saving a cache and the key used to search for a cache
  • D. dependency: the name and version of a package to cache or restore
  • E. ref: the ref name of the branch to access and restore a cache created
  • F. path: the file path on the runner to cache or restore

Answer: C,F

Explanation:
The key is required because it uniquely identifies the cache. It is used to store and retrieve cached data. When creating or restoring a cache, you need to define a key that will be used to identify the cache.
The path is the file path on the runner that you want to cache. This is where the cached files or dependencies are located and should be specified to tell GitHub where to store or retrieve the cache from.


NEW QUESTION # 21
What menu options in a repository do you need to select in order to use a starter workflow that is provided by your organization?

  • A. Workflow > New workflow
  • B. Workflow > Load workflow
  • C. Actions > New workflow
  • D. Actions > Load workflow

Answer: C

Explanation:
To use a starter workflow provided by your organization, you need to go to the Actions tab in the repository and select New workflow. This option allows you to either create a new workflow or select from a list of available workflow templates, including starter workflows provided by your organization.


NEW QUESTION # 22
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?

  • A. runs-on: windows-latest
  • B. runs-on: [self-hosted, windows, x64]
  • C. self-hosted: [windows-x64]
  • D. self-hosted: [windows, x64]

Answer: B

Explanation:
The runs-on keyword allows you to specify the operating system and other labels for the runner. By specifying self-hosted, windows, and x64, you are targeting a self-hosted Windows runner that matches these criteria, which aligns with the custom configuration of your self-hosted runner.


NEW QUESTION # 23
You are reaching your organization's storage limit for GitHub artifacts and packages. What should you do to prevent the storage limit from being reached? (Choose two.)

  • A. Use self-hosted runners for all workflow runs.
  • B. Disable branch protections in the repository.
  • C. Configure the repo to use Git Large File Storage.
  • D. Configure the artifact and log retention period.
  • E. Delete artifacts from the repositories manually

Answer: D,E

Explanation:
Deleting artifacts from repositories manually will free up storage space. Artifacts are typically stored for a limited time by default, but manual cleanup can help manage space.
Configuring the artifact and log retention period allows you to control how long artifacts and logs are retained in your repository. By shortening the retention period, you can prevent unnecessary accumulation of data and manage storage more effectively.


NEW QUESTION # 24
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?

  • A. Add the workflow_run webhook event as a trigger for the workflow for the code quality integration name
  • B. Add the check_run webhook event as a trigger for the workflow when the code quality integration is completed
  • C. Add the pull_request webhook event as a trigger for the workflow when the code quality integration is synchronized
  • D. Add the deployment webhook event as a trigger for the workflow when the code quality integration is completed

Answer: 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.


NEW QUESTION # 25
Which of the following commands will set the $FOO environment variable within a script, so that it may be used in subsequent workflow job steps?

  • A. run: echo "FOO=bar" >> $GITHUB_ENV
  • B. run: echo ${{ $FOO=bar }}
  • C. run: export FOO=bar
  • D. run: echo "::set-env name=FOO::bar"

Answer: A

Explanation:
The $GITHUB_ENV environment variable is used to set environment variables that persist across steps in a workflow job. By echoing FOO=bar into $GITHUB_ENV, the variable FOO will be available in subsequent steps within the same job.


NEW QUESTION # 26
As a developer, you need to create a custom action written in Python. Which action type should you choose?
As a developer, you need to create a custom action written in Python. Which action type should you choose?

  • A. Python action
  • B. Docker container action
  • C. composite run step
  • D. JavaScript action

Answer: B

Explanation:
A Docker container action is ideal for custom actions that require specific environments or dependencies, such as Python. By creating a Docker container, you can define the environment with the necessary Python version and dependencies, and your Python code can run inside that container.


NEW QUESTION # 27
A development team has been using a Powershell script to compile and package their solution using existing tools on a Linux VM, which has been configured as a self-hosted runner. They would like to use the script as-is in an automated workflow. Which of the following should they do to invoke their script within a workflow step?

  • A. Use the YAML shell: pwsh in a run step.
  • B. Run the pwsh2bash command to convert the script so it can be run on Linux.
  • C. Use the actions/run-powershell action to invoke the script.
  • D. Configure a self-hosted runner on Windows with the requested tools.
  • E. Use the YAML powershell: step.

Answer: A

Explanation:
Since the self-hosted runner is configured on a Linux VM and the script is written in PowerShell, you can invoke the script using the pwsh (PowerShell Core) shell in a run step in the workflow. This ensures that the script runs as-is on the Linux runner, as PowerShell Core (pwsh) is cross-platform and supports Linux.


NEW QUESTION # 28
Which default environment variable specifies the branch or tag that triggered a workflow?

  • A. GITHUB_BRANCH
  • B. ENV_BRANCH
  • C. GITHUB_TAG
  • D. GITHUB_REF

Answer: D

Explanation:
The GITHUB_REF environment variable specifies the branch or tag that triggered the workflow. It contains the full reference to the branch or tag, such as refs/heads/main for a branch or refs/tags/v1.0 for a tag.


NEW QUESTION # 29
As a developer, you want to run a workflow from the Actions tab in GitHub. Which YAML snippet should you use to match the interface in this image?

  • A.
  • B.
  • C.
  • D.

Answer: C

Explanation:
The first image shows a workflow trigger with an option for the test suite, and the chosen YAML configuration matches this interface. Specifically, the test suite input is defined with type: choice and includes the option value: functional, which aligns with the visible UI elements in the first image.


NEW QUESTION # 30
What is the right method to ensure users approve a workflow before the next step proceeds?

  • A. granting users workflow approval permissions
  • B. creating a branch protection rule and only allow certain users access
  • C. adding users as required reviewers for an environment
  • D. granting users repository approval permissions

Answer: C

Explanation:
GitHub Actions allows you to configure environment protection rules, where you can require specific users or teams to approve the deployment before the workflow proceeds to the next step. This ensures that the required reviewers approve the workflow before any sensitive actions (such as deployment) occur.


NEW QUESTION # 31
......

Certification Topics of GH-200 Exam PDF Recently Updated Questions: https://quizmaterials.dumpsreview.com/GH-200-exam-dumps-review.html