Latest GH-200 Actual Free Exam Updated 102 Questions
Online Questions - Valid Practice GH-200 Exam Dumps Test Questions
Microsoft GH-200 Exam Syllabus Topics:
| Topic | Details |
|---|---|
| Topic 1 |
|
| Topic 2 |
|
| Topic 3 |
|
| Topic 4 |
|
NEW QUESTION # 16
What are the two ways to pass data between jobs? (Choose two.)
- A. Use job outputs
- B. Use data storage.
- C. Use the copy action with restore parameter to restore the data from the cache
- D. Use the copy action to save the data that should be passed in the artifacts folder.
- E. Use artifact storage.
- F. Use the copy action with cache parameter to cache the data
Answer: A,E
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 # 17
In GitHub Actions, how is the success or failure of a step determined by its exit code?
- A. Every exit code is a failure
- B. Exit codes are ignored and a maintainer sets the result manually
- C. Zero exit code means success and any nonzero means failure
- D. Success is controlled by continue-on-error rather than the exit code
Answer: C
Explanation:
GitHub Actions evaluates each step by the exit status of the process it runs. The runner marks a step successful when the command finishes with an exit status of 0. If the command returns any other code then the step is marked as failed and the job may stop depending on your workflow configuration.
NEW QUESTION # 18
You need to publish a release that includes assets in GitHub Actions. The solution must meet GitHub support requirements. What should you do?
- A. Run gh release create in a script step to create a release and attach the assets after tagging a commit.
- B. Use a GitHub Marketplace action that creates a release and uploads the assets in a single step.
- C. Run git push --tags to automatically trigger GitHub to create a release that includes all the project files.
- D. Run actions/upload-artifact followed by actions/create-release, and then actions/upload-release- asset.
Answer: A
Explanation:
To publish a release and attach assets using the GitHub CLI (gh) within a GitHub Actions script, you can use the gh release create command. This approach is often preferred over third-party actions because the CLI is pre-installed on GitHub-hosted runners.
Core Command Syntax
The basic syntax to create a release and attach files simultaneously is:
gh release create <tag> [<files>...] [flags]
Note:
Implementation in GitHub Actions
To use this in a workflow, ensure your job has contents: write permissions and that you provide the GH_TOKEN environment variable so the CLI can authenticate.
permissions:
contents: write
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
# (Optional) Build your assets here (e.g., zip, tar.gz, or binaries)
- name: Create Release and Upload Assets
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release create v1.0.0 ./dist/my-asset.zip --title "v1.0.0" --notes "Release notes here" Reference:
https://michael-mckenna.com/how-to-upload-file-to-github-release-in-a-workflow
NEW QUESTION # 19
As a developer, what two options should you recommend to implement standards for automation reuse? Each correct answer presents a complete solution. NOTE: Each correct answer is worth one point.
- A. Create reusable actions and workflows that can be called from other workflows.
- B. Create workflow templates and store them in the organization's .github repository.
- C. Store shared corporate actions in subfolders in a defined and documented internally accessible repository.
- D. Create a marketplace partition to publish reusable automation for the company.
Answer: A,C
Explanation:
[A]
Implementing standards for reusable actions and workflows is the most effective way to reduce duplication and maintain consistency across your GitHub organization.
Reusable Workflows (workflow_call)
Best for standardizing entire processes (e.g., a complete CI/CD pipeline).
Location: Defined in .github/workflows/ of a central repository.
Trigger: Use the on: workflow_call trigger to define inputs, secrets, and outputs.
Usage: Called from another workflow using the uses keyword (e.g.,
owner/repo/.github/workflows/ci.yml@v1).
Benefit: They allow you to enforce security scans, build steps, and deployment gates across multiple repositories from a single source
[C]
Implementing a marketplace partition for internal GitHub Actions is a key strategy for scaling automation securely and efficiently across a company. This centralized approach ensures that developers use vetted, high-quality automation while adhering to corporate standards.
Strategic Implementation of Internal Reuse
To implement standards for automation reuse effectively, focus on these core components:
[C] Internal Actions Marketplace: Create a dedicated organization or specific repositories to host and display shared actions. This "marketplace" acts as a curated directory of approved automations, preventing the use of unverified third-party actions from the public marketplace.
Workflow Templates: Store standardized workflow templates in your organization's .github repository. These templates appear in the "Actions" tab when a user creates a new workflow, ensuring consistency across different teams.
[A] Reusable Workflows: Design modular workflows that can be called by other repositories using the uses keyword. Unlike standard actions, these can manage entire jobs and runners, making them ideal for standardizing complex CI/CD pipelines.
Internal Repository Sharing: Set repository visibility to Internal and configure Actions permissions to allow access from other repositories in the organization or enterprise.
Reference:
https://www.incredibuild.com/blog/best-practices-to-create-reusable-workflows-on-github-actions
https://xebia.com/blog/setting-up-an-internal-github-actions-marketplace
NEW QUESTION # 20
What is the simplest action type to run a shell script?
- A. Docker container action
- B. Bash script action
- C. JavaScript action
- D. Composite action
Answer: D
Explanation:
The simplest official GitHub Actions action type for running shell commands or shell scripts is a composite action. Composite actions allow an action author to combine one or more run steps and reusable workflow commands in an action.yml file without needing to package a Docker image or write a JavaScript action.
Option B is correct because it directly supports shell-based automation. Option A is heavier because Docker container actions require a container image or Dockerfile. Option D is used when the action logic is written in JavaScript and executed with Node.js. Option C is incorrect because "Bash script action" is not an official GitHub Actions action type. This topic checks custom action types and reuse patterns.
NEW QUESTION # 21
Which command can you include in your workflow file to set the output parameter for an action?
- A. echo "::add-mask::$ACTI0N_C0L0R"
- B. echo "action_color=purple" >> $GITHUB_OUTPUT
- C. echo "::debug::action_color=purple"
- D. echo "action_color=purple" >> $GITHUB_ENV
Answer: B
Explanation:
Setting an output parameter
Sets a step's output parameter. Note that the step will need an id to be defined to later retrieve the output value. You can set multi-line output values with the same technique used in the Multiline strings section to define multi-line environment variables.
echo "{name}={value}" >> "$GITHUB_OUTPUT"
Example of setting an output parameter
This example demonstrates how to set the SELECTED_COLOR output parameter and later retrieve it:
- name: Set color
id: color-selector
run: echo "SELECTED_COLOR=green" >> "$GITHUB_OUTPUT"
- name: Get color
env:
SELECTED_COLOR: ${{ steps.color-selector.outputs.SELECTED_COLOR }}
run: echo "The selected color is $SELECTED_COLOR"
Reference:
https://docs.github.com/en/actions/reference/workflows-and-actions/workflow-commands
NEW QUESTION # 22
As a DevOps engineer, you are developing workflows to build an application. You have a requirement to create the build targeting multiple node versions. Which code block should you use to define the workflow?
- A.

- B.

- C.

- D.

Answer: C
Explanation:
Use keywords strategy and matrix in that order.
Last line should be node-version: ${{ matrix.node-ver}}
Reference:
https://docs.github.com/en/actions/how-tos/write-workflows/choose-what-workflows-do/run-job- variations
NEW QUESTION # 23
As a developer, how can you identify a JavaScript action on GitHub?
- A. The action's repository includes a js.yml file in the .github/workflows directory.
- B. The action.yml metadata file references a package.json file.
- C. The action.yml metadata file has the runs.using value set to node16.
- D. The action's repository name includes the keyword "JavaScript."
Answer: B
Explanation:
Creating a JavaScript action, example
Prerequisites
Before you begin, you'll need to download Node.js and create a public GitHub repository.
* steps omitted *
From your terminal, initialize the directory with npm to generate a package.json file.
npm init -y
Adding actions toolkit packages
The actions toolkit is a collection of Node.js packages that allow you to quickly build JavaScript actions with more consistency.
When you commit and push your code, your updated repository should look like this:
hello-world-javascript-action/
─ action.yml
─ dist/
─ index.js
─ package.json
─ package-lock.json
─ README.md
─ rollup.config.js
─ src/
─ index.js
Reference:
https://docs.github.com/en/actions/tutorials/create-actions/create-a-javascript-action#creating-an- action-metadata-file
NEW QUESTION # 24
As a developer, you are using a Docker container action in your workflow. What is required for the action to run successfully?
- A. The job runs-on must specify a Linux machine with Docker installed.
- B. The referenced action must be hosted on Docker Hub.
- C. The job env must be set to a Linux environment.
- D. The action must be published to the GitHub Marketplace.
Answer: A
Explanation:
For a Docker container action to run in a GitHub Actions workflow, the runner must have Docker installed. The runs-on attribute of the job should specify an environment that supports Docker, typically a Linux environment (e.g., ubuntu-latest), since Docker is widely supported and commonly used in Linux-based environments.
NEW QUESTION # 25
As a developer, what options should you recommend to implement standards for automation reuse? (Choose two.)
- A. Store shared corporate actions in subfolders in a defined and documented internally accessible repository.
- B. Create reusable actions and workflows that can be called from other workflows.
- C. Create workflow templates and store them in the organization's .github repository.
- D. Create a marketplace partition to publish reusable automation for the company.
Answer: B,C
Explanation:
Creating workflow templates in the organization's .github repository allows the organization to standardize workflows and make them easily reusable across multiple repositories. This ensures consistency and simplifies maintenance.
Creating reusable actions and workflows that can be called from other workflows helps modularize and standardize automation tasks. These reusable components can be maintained centrally and called from different workflows across repositories.
NEW QUESTION # 26
As a developer, you want to review the step that caused a workflow failure and the failed step's build logs. First navigate to the main page of the repository on GitHub. Which section contains the step failure information?
- A. Pull requests
- B. Code
- C. Insights
- D. Issues
- E. Actions
Answer: E
Explanation:
The Actions tab on the main page of the repository is where you can find detailed information about the workflow runs, including step failures and build logs. You can review the status of each job and step within the workflow, see the failure messages, and access logs for debugging.
NEW QUESTION # 27
You are a developer working on developing reusable workflows for your organization. What keyword should be included as part of the reusable workflow event triggers?
- A. workflow_run
- B. pull_request
- C. workflow_call
- D. check_run
Answer: C
Explanation:
The workflow_call event is used to trigger a reusable workflow from another workflow. This allows you to create workflows that can be reused in multiple places within your organization, enabling better modularity and reducing duplication.
NEW QUESTION # 28
In the following workflow file, line 5 interprets lines 3 and 4 as Python. Which of the following is a valid option to complete line 5?
1 steps:
2 - run: |
3 import os
4 print(os.environ['PATH'])
5
- A. shell: bash
- B. with: python
- C. shell: python
- D. working-directory: .github/python
Answer: C
Explanation:
Workflow syntax for GitHub Actions
Example: Running an inline Python script
steps:
- name: Display the path
shell: python
run: |
import os
print(os.environ['PATH'])
Reference:
https://docs.github.com/en/actions/reference/workflows-and-actions/workflow-syntax
NEW QUESTION # 29
Your organization is managing secrets using GitHub encrypted secrets, including a secret named SuperSecret. As a developer, you need to create a version of that secret that contains a different value for use in a workflow that is scoped to a specific repository named MyRepo. How should you store the secret to access your specific version within your workflow?
- A. Create a file with the SuperSecret. information in the .qithub/secrets folder in MyRepo.
- B. Create MyRepo_SuperSecret in GitHub encrypted secrets to specify the scope to MyRepo.
- C. Create a duplicate entry for SuperSecret in the encrypted secret store and specify MyRepo as the scope.
- D. Create and access SuperSecret from the secrets store in MyRepo.
Answer: B
Explanation:
To scope a secret to a specific repository, you can create a new secret with a name like MyRepo_SuperSecret in the secrets section of the MyRepo repository's settings. This ensures that the secret is specific to that repository and can be used within its workflows.
NEW QUESTION # 30
Which workflow commands send information from the runner? (Each correct answer presents a complete solution. Choose two.)
- A. reading from environment variables
- B. populating variables in a Dockerfile
- C. setting output parameters
- D. setting a debug message
Answer: C,D
Explanation:
[B] Setting a debug message
Prints a debug message to the log. You must create a secret named ACTIONS_STEP_DEBUG with the value true to see the debug messages set by this command in the log.
::debug::{message}
Example: Setting a debug message
echo "::debug::Set the Octocat variable"
[D] Setting an output parameter
Sets a step's output parameter. Note that the step will need an id to be defined to later retrieve the output value.
echo "{name}={value}" >> "$GITHUB_OUTPUT"
Example of setting an output parameter
This example demonstrates how to set the SELECTED_COLOR output parameter and later retrieve it:
- name: Set color
id: color-selector
run: echo "SELECTED_COLOR=green" >> "$GITHUB_OUTPUT"
- name: Get color
env:
SELECTED_COLOR: ${{ steps.color-selector.outputs.SELECTED_COLOR }}
run: echo "The selected color is $SELECTED_COLOR"
Reference:
https://docs.github.com/en/actions/reference/workflows-and-actions/workflow-commands
NEW QUESTION # 31
As a DevOps engineer developing a JavaScript action, you need to include annotations to pass warning messages to workflow runners. Which code snippet can you use to implement an annotation in your Actions?
As a DevOps engineer developing a JavaScript action, you need to include annotations to pass warning messages to workflow runners. Which code snippet can you use to implement an annotation in your Actions?
- A. core.notice('Something went wrong, but it\'s not bad enough to fail the build.')
- B. core.info('Something went wrong, but it\'s not bad enough to fail the build.')
- C. core.warning('Something went wrong, but it\'s not bad enough to fail the build.')
- D. core.warn('Something went wrong, but it\'s not bad enough to fail the build.')
Answer: C
Explanation:
The core.warning() function from the @actions/core package is used to create a warning message in the workflow logs. This is an annotation type that informs users about issues that don't require failing the build but still need attention.
NEW QUESTION # 32
Your organization needs to simplify reusing and maintaining automation in your GitHub Enterprise Cloud. Which components can be directly reused across all repositories in an organization?
(Each correct answer presents a complete solution. Choose three.)
- A. workflow templates
- B. encrypted secrets
- C. actions stored in an organizational partition in the GitHub Marketplace
- D. custom Docker actions stored in GitHub Container Registry
- E. self-hosted runners
- F. actions stored in private repositories in the organization
Answer: A,B,F
Explanation:
[D] Encrypted secrets can be accessed across repositories in the same organization, making it easy to store sensitive data (like API keys or tokens) securely while allowing multiple workflows to access them.
[E] Workflow templates allow you to create reusable templates for workflows that can be shared across repositories within the organization. This makes it easier to standardize processes and automate them across multiple projects.
[F] Actions stored in private repositories within the organization can be reused across all repositories by referencing them in workflows. This ensures a centralized way of maintaining custom actions.
Reference:
https://docs.github.com/en/actions/how-tos/reuse-automations/reuse-workflows
NEW QUESTION # 33
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. composite run step
- B. JavaScript action
- C. Python action
- 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 # 34
Which scopes are available to define custom environment variables within a workflow file?
(Choose three.)
- A. the entire workflow, by using env at the top level of the workflow file
- B. the contents of a job within a workflow, by using jobs.env
- C. within the run attribute of a job step
- D. a specific step within a job, by using jobs..steps[*].env
- E. the entire stage, by using env at the top of the defined build stage
- F. all jobs being run on a single Actions runner, by using runner.env at the top of the workflow file
Answer: A,B,D
Explanation:
Defining environment variables for a single workflow
To set a custom environment variable for a single workflow, you can define it using the env key in the workflow file. The scope of a custom variable set by this method is limited to the element in which it is defined. You can define variables that are scoped for:
[A] The entire workflow, by using env at the top level of the workflow file.
[E] The contents of a job within a workflow, by using jobs.<job_id>.env.
[F] A specific step within a job, by using jobs.<job_id>.steps[*].env.
Reference:
https://docs.github.com/en/actions/how-tos/write-workflows/choose-what-workflows-do/use- variables
NEW QUESTION # 35
Which of the following statements are true regarding the use of GitHub Actions on a GitHub Enterprise Server instance? (Choose three.)
- A. Third party actions can be used on GitHub Enterprise Server by configuring GitHub Connect
- B. Actions created by GitHub are automatically available and cannot be disabled
- C. Most GitHub authored actions are automatically bundled for use on GitHub Enterprise Server
- D. Third party actions can be manually synchronized for use on GitHub Enterprise Server
- E. Actions must be defined in the .github repository
- F. Use of GitHub Actions on GitHub Enterprise Server requires a persistent internet connection
Answer: A,D,F
NEW QUESTION # 36
......
GH-200 Exam PDF [2026] Tests Free Updated Today with Correct 102 Questions: https://www.actualtorrent.com/GH-200-questions-answers.html
100% Real GH-200 dumps - Brilliant GH-200 Exam Questions PDF: https://drive.google.com/open?id=1W72ojgSUx8lLliVFFtbe_Q6f3ef1LaeA