Get ready to pass the GH-200 Exam right now using our GitHub Administrator Exam Package [Q20-Q36]

Share

Get ready to pass the GH-200 Exam right now using our GitHub Administrator Exam Package

A fully updated 2026 GH-200 Exam Dumps exam guide from training expert Actual4Dumps

NEW QUESTION # 20
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.
Variables set in GITHUB_ENV apply only to the current job.
Example:
echo "PR_NUMBER=$pr_number" >> $GITHUB_ENV
Reference:
https://github.com/orgs/community/discussions/56849


NEW QUESTION # 21
A single secret must be accessed by workflows in specific repositories. What is the best way to create the secret?

  • A. Store the secret in a supported external key vault. Configure OpenID Connect (OIDC) to allow access to the external vault and link the secret from the external key vault in each of the specific repositories.
  • B. Create an organization secret, specify Selected repositories as the Repository access, and select the required repositories.
  • C. Create the secret in one of the repositories, check the Share secret option, and select the required repositories.
  • D. Create an environment secret at the organization level and leverage that environment in each of the specified repositories.

Answer: B

Explanation:
Creating secrets for an organization
When creating a secret or variable in an organization, you can use a policy to limit access by repository. For example, you can grant access to all repositories, or limit access to only private repositories or a specified list of repositories.
To specify that the secret should be available to selected repositories within the organization, use the --repos or -r flag.
gh secret set --org ORG_NAME SECRET_NAME --repos REPO-NAME-1, REPO-NAME-2 Note: REST API endpoints for GitHub Actions Secrets Use the REST API to interact with secrets in GitHub Actions.
* Set selected repositories for an organization secret
Replaces all repositories for an organization secret when the visibility for repository access is set to selected. The visibility is set when you Create or update an organization secret.
Request example
Put /orgs/{org}/actions/secrets/{secret_name}/repositories
Reference:
https://docs.github.com/en/actions/how-tos/write-workflows/choose-what-workflows-do/use- secrets
https://docs.github.com/en/rest/actions/secrets?apiVersion=2022-11-28#set-selected- repositories-for-an-organization-secret


NEW QUESTION # 22
As a developer, your self-hosted runner sometimes looses connection while running jobs. How should you troubleshoot the issue affecting your self-hosted runner?

  • A. Set the DEBUG environment variable to true before starting the self-hosted runner to produce more verbose console output.
  • B. Start the self-hosted runner with the --debug flag to produce more verbose console output.
  • C. Access the self-hosted runner's installation directory and look for log files in the _diag folder.
  • D. Locate the self-hosted runner in your repository's settings page and download its log archive.

Answer: C

Explanation:
When troubleshooting a self-hosted runner, you can access the _diag folder located in the self-hosted runner's installation directory. This folder contains diagnostic logs that can help you identify the root cause of issues, such as connection problems.


NEW QUESTION # 23
Which action type should be used to bundle a series of run steps into a reusable custom action?

  • A. JavaScript action
  • B. Docker container action
  • C. Composite action
  • D. Bash script action

Answer: C

Explanation:
Reusable workflows versus composite actions
Reusable workflows and composite actions both help you avoid duplicating workflow content.
Whereas reusable workflows allow you to reuse an entire workflow, with multiple jobs and steps, composite actions combine multiple steps that you can then run within a job step, just like any other action.
A composite action allows you to bundle multiple steps into a single reusable action within a workflow. It is composed of multiple run steps or other actions and can be reused across workflows, making it the perfect choice for bundling a series of steps.
Reference:
https://docs.github.com/en/actions/concepts/workflows-and-actions/reusable-workflows


NEW QUESTION # 24
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? (Each correct answer presents a complete solution. Choose two.)

Answer:

Explanation:
B.C
Explanation:
[E] To bypass GitHub's limit of 100 MB you can use Git Large File Storage (Git LFS). It stores references to your file in the repo by creating a pointer file. However, the actual file is going to be stored at a different location.
[C] Configuring the retention period for GitHub Actions artifacts and logs in your organization You can configure the retention period for GitHub Actions artifacts and logs in your organization.
By default, the artifacts and log files generated by workflows are retained for 90 days before they are automatically deleted. You can adjust the retention period, depending on the type of repository:
For public repositories: you can change this retention period to anywhere between 1 day or 90 days.
For private repositories: you can change this retention period to anywhere between 1 day or 400 days.
When you customize the retention period, it only applies to new artifacts and log files, and does not retroactively apply to existing objects. For managed repositories and organizations, the maximum retention period cannot exceed the limit set by the managing organization or enterprise.
Reference:
https://gitprotect.io/blog/github-storage-limits/
https://docs.github.com/en/organizations/managing-organization-settings/configuring-the- retention-period-for-github-actions-artifacts-and-logs-in-your-organization


NEW QUESTION # 25
In GitHub Actions, which workflow key defines the events that trigger the workflow such as push or pull_request?

  • A. on:
  • B. if:
  • C. jobs:
  • D. env:

Answer: A

Explanation:
The correct option is on: which specifies the events such as push and pull_request that trigger a GitHub Actions workflow to run.
In a workflow file this key accepts one or many events and can include filters like branches and paths for push and pull_request so it defines exactly when the workflow starts.


NEW QUESTION # 26
As a developer, you are authoring a workflow that will deploy to both DevCloud and TestCloud resources. Each cloud resource is accessed with a different deployment key. Which approach best allows you to use the same reusable workflow in separate jobs to target the different cloud resources?

  • A. Use a marketplace action to conditionally parse the DEPLOY_KEY repository secret based on the cloud resource name.
  • B. Create repository secrets named DevCloud.DEPLOY_KEY and TestCloud.DEPLOY_KEY so that the reusable workflow parses the secrets by resource name.
  • C. Store the different keys in a DEPLOY_KEY environment secret in the DevCloud and TestCloud environments. Specify DEPLOY_KEY in the secrets section of the reusable workflow.
  • D. Populate a DEPLOY_KEY repository secret with a JSON object containing DevCloud and TestCloud properties. Then specify DEPLOY_KEY.DevCloud in the secrets sections of the reusable workflow.

Answer: C

Explanation:
Using inputs and secrets in a reusable workflow
You can define inputs and secrets, which can be passed from the caller workflow and then used within the called workflow.
In the reusable workflow, use the inputs and secrets keywords to define inputs or secrets that will be passed from a caller workflow.
on:
workflow_call:
inputs:
config-path:
required: true
type: string
secrets:
personal_access_token:
required: true
Reference:
https://docs.github.com/en/enterprise-cloud@latest/actions/how-tos/reuse-automations/reuse- workflows


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

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

Answer: A,C

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 # 28
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. JavaScript action
  • B. Python action
  • C. composite run step
  • D. Docker container action

Answer: D

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 # 29
You need to create a reusable GitHub Actions workflow template named ci.yml. The solution must ensure that ci.yml appears on the New workflow interface of GitHub Actions. Where should you store ci.yml?

  • A. .github/templates
  • B. the root directory of each repository
  • C. .github/workflows
  • D. .github/workflow-templates

Answer: D

Explanation:
To ensure your reusable GitHub Actions workflow template appears in the New workflow interface (also known as the starter workflow picker), it must be stored in a specific directory within a special repository in your organization.
Required Storage Location
Repository Name: .github (This must be a public repository at the root of your organization).
Directory Path: workflow-templates.
Note:
Essential Files to Include
For the template to be correctly indexed and displayed in the interface, you must include two files in the workflow-templates directory:
The Workflow File: A standard YAML file (e.g., ci-template.yml) containing the workflow definition.
The Metadata File: A JSON file that must have the same name as the workflow file but with a .properties.json extension (e.g., ci-template.properties.json).
Reference:
https://docs.github.com/en/[email protected]/actions/using-workflows/creating-starter- workflows-for-your-organization


NEW QUESTION # 30
What repository visibility is required for a GitHub Action to be listed on GitHub Marketplace?

  • A. Use GitHub Container Registry
  • B. Public repository
  • C. Metadata in a subfolder
  • D. Verified creator status

Answer: B

Explanation:
GitHub only lists actions from repositories that are visible to everyone. This is a firm requirement for publishing an action to the Marketplace and private or internal repositories cannot be listed.


NEW QUESTION # 31
How many jobs will result from the following matrix configuration?

  • A. 5 jobs
  • B. 6 jobs
  • C. 4 jobs
  • D. 3 jobs

Answer: B

Explanation:
The matrix configuration specifies two variables: color and animal. The color variable has 2 values (green and pink), and the animal variable has 2 values (owl and magpie). This would result in 4 combinations (2 color values × 2 animal values). Additionally, the include section introduces two more combinations (color: blue and animal: owl; color: pink and animal: magpie).


NEW QUESTION # 32
Which default GitHub environment variable indicates the name of the person or app that initiated a workflow?

  • A. GITHUB_WORKFLOW_ACTOR
  • B. GITHUB_USER
  • C. GITHUB_ACTOR
  • D. ENV_ACTOR

Answer: C

Explanation:
The GITHUB_ACTOR environment variable indicates the name of the person or app that initiated the workflow. This variable is automatically provided by GitHub in the workflow and can be used to identify the user or application triggering the workflow.


NEW QUESTION # 33
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. Disable branch protections in the repository.
  • B. Delete artifacts from the repositories manually
  • C. Use self-hosted runners for all workflow runs.
  • D. Configure the repo to use Git Large File Storage.
  • E. Configure the artifact and log retention period.

Answer: B,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 # 34
You need to stop a GitHub Actions workflow from running. The solution must retain the configuration and execution history of the workflow. What should you do?

  • A. Archive the workflow in a new branch.
  • B. Delete the workflow YAML file from the repository.
  • C. Rename the workflow YAML file.
  • D. Select Actions and disable the workflow.

Answer: D

Explanation:
To stop a GitHub Actions workflow while keeping its configuration file and execution history, you should disable the workflow rather than deleting it. Disabling a workflow prevents it from being triggered by any event (like pushes or schedules) but leaves the YAML file in your repository and preserves all previous run data on the GitHub Actions tab.
How to Disable a Workflow
You can disable a workflow through the GitHub UI, the CLI, or by modifying the code itself:
Via GitHub Web Interface:
Go to your repository on GitHub.
Click the Actions tab.
In the left sidebar, select the specific workflow you want to stop.
Click the three dots (...) or the Enable/Disable dropdown menu and select Disable workflow.
Reference:
https://docs.github.com/actions/managing-workflow-runs/disabling-and-enabling-a-workflow


NEW QUESTION # 35
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. Actions > New workflow
  • B. Workflow > New workflow
  • C. Actions > Load workflow
  • D. Workflow > Load workflow

Answer: A

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 # 36
......

Master 2026 Latest The Questions GitHub Administrator and Pass GH-200 Real Exam!: https://www.actual4dumps.com/GH-200-study-material.html

Practice To GH-200 - Actual4Dumps Remarkable Practice On your GitHub Actions Exam: https://drive.google.com/open?id=1_4TLEY80XtloPWlUmk_F6MhhofJV25D0