最新Microsoft GH-200一発合格!試験リアル問題集最新の[2026年05月]
良質なGH-200問題集はここFast2test問題はあなたの合格させて見せます。明るい未来はクリックから始まる!
質問 # 36
When should you use the GITHUB_TOKEN in a workflow?
- A. when you want to call an action from the marketplace
- B. when you want to make authenticated calls to the GitHub API
- C. when you want to access repository-level secrets
- D. when you want to connect to the runner via SSH
正解:B
解説:
Use GITHUB_TOKEN for authentication in workflows
At the start of each workflow job, GitHub automatically creates a unique GITHUB_TOKEN secret to use in your workflow. You can use the GITHUB_TOKEN to authenticate in the workflow job.
Reference:
https://docs.github.com/en/actions/tutorials/authenticate-with-github_token
質問 # 37
What can be used to set a failed status of an action from its code?
- A. JavaScript dist/ folder
- B. a non-zero exit code
- C. output variable
- D. Dockerfile CMD
- E. @actions/github toolkit
- F. composite run step
正解:B
解説:
A non-zero exit code is used to set the status of an action to "failed" in GitHub Actions. When the action's script or code exits with a non-zero status, it indicates failure, and GitHub will mark the action as failed.
質問 # 38
Which files are required for a Docker container action in addition to the source code? (Each correct answer presents a partial solution. Choose two.)
- A. Dockerfile
- B. metadata.yml
- C. Actionfile
- D. action.yml
正解:A、D
解説:
Creating a Docker container action
Create a dockerfile
Dockerfile support for GitHub Actions
When creating a Dockerfile for a Docker container action, you should be aware of how some Docker instructions interact with GitHub Actions and an action's metadata file.
Creating an action metadata file
Create a new action.yml file.
Reference:
https://docs.github.com/en/actions/tutorials/use-containerized-services/create-a-docker-container- action
https://docs.github.com/en/actions/reference/workflows-and-actions/dockerfile-support
質問 # 39
You need to create new workflows to deploy to an unfamiliar cloud provider. What is the fastest and safest way to begin?
- A. Search GitHub Marketplace for actions created by GitHub.
- B. Download the CLI for the cloud provider and review the associated documentation.
- C. Search GitHub Marketplace for verified actions published by the cloud provider.
- D. Use the actions/jenkins-plugin action to utilize an existing Jenkins plugin for the cloud provider.
- E. Create a custom action to wrap the cloud provider's CLI.
正解:C
解説:
Searching the GitHub Marketplace for verified actions published by the cloud provider is the quickest and safest approach. Many cloud providers offer verified GitHub Actions that are maintained and optimized to interact with their services. These actions typically come with the correct configurations and best practices, allowing you to get started quickly without reinventing the wheel.
Note: About GitHub Marketplace for apps
GitHub Marketplace where you can share your apps with everyone.
GitHub Marketplace connects you to developers who want to extend and improve their GitHub workflows. You can list free and paid tools for developers to use in GitHub Marketplace. GitHub Marketplace offers developers two types of tools: GitHub Actions and Apps, and each tool requires different steps for adding it to GitHub Marketplace.
GitHub Actions
Anyone can publish an action in GitHub Marketplace. GitHub verifies some partner organizations and these are shown as verified creators.
Reference:
https://docs.github.com/en/enterprise-cloud@latest/apps/github-marketplace/github-marketplace- overview/about-github-marketplace-for-apps
質問 # 40
What are the mandatory requirements for publishing GitHub Actions to the GitHub Marketplace?
(Each correct answer presents part of the solution. Choose two.)
- A. The action's metadata file must be in the root directory of the repository.
- B. The action can be either in a public or private repository.
- C. The action's name cannot match a user or organization on GitHub unless the user or organization owner is publishing the action.
- D. The name should match with one of the existing GitHub Marketplace categories.
- E. Each repository can contain a collection of actions as long as they are under the same Marketplace category.
正解:A
解説:
Publishing actions in GitHub Marketplace
You can publish actions in GitHub Marketplace and share actions you've created with the GitHub community.
Prerequisite include:
[B] Each repository must contain a single action metadata file (action.yml or action.yaml) at the root.
The name in the action's metadata file must be unique.
The name cannot match an existing action name published on GitHub Marketplace.
[C] The name cannot match a user or organization on GitHub, unless the user or organization owner is publishing the action. For example, only the GitHub organization can publish an action named github.
Reference:
https://docs.github.com/en/actions/how-tos/create-and-publish-actions/publish-in-github- marketplace
質問 # 41
Which default environment variable specifies the branch or tag that triggered a workflow?
- A. GITHUB_TAG
- B. ENV_BRANCH
- C. GITHUB_BRANCH
- D. GITHUB_REF
正解:D
解説:
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.
質問 # 42
Which workflow event is used to manually trigger a workflow run?
- A. status
- B. workflow_run
- C. create
- D. workflow_dispatch
正解:D
解説:
The workflow_dispatch event is used to manually trigger a workflow run in GitHub Actions. You can specify this event in the workflow file to allow users to manually trigger the workflow from the GitHub UI, often with optional input parameters.
質問 # 43
As a developer, you need to add the correct syntax to allow the following workflow file to be triggered by multiple types of events. Which two code blocks should you add starting at line 5?
(Each correct answer presents a complete solution. Choose two.)
- A. on:
env:
- 'prod'
- 'qa'
- 'test' - B. on: [push, pull_request]
- C. on: [push, commit]
- D. on:
schedule:
- cron: '*/15 * * * *'
initiate:
- 'main' - E. on:
branches:
- 'main'
- 'dev' - F. on:
push:
branches:
- main
release:
types:
- created
正解:D
解説:
To automatically trigger a workflow, use on to define which events can cause the workflow to run.
You can define single or multiple events that can trigger a workflow, or set a time schedule. You can also restrict the execution of a workflow to only occur for specific files, tags, or branch changes.
[A] push and pull_request are both events that can trigger a workflow.
Note: Using multiple events
You can specify a single event or multiple events. For example, a workflow with the following on value will run when a push is made to any branch in the repository or when someone forks the repository:
on: [push, fork]
If you specify multiple events, only one of those events needs to occur to trigger your workflow. If multiple triggering events for your workflow occur at the same time, multiple workflow runs will be triggered.
[C] on.schedule
You can use on.schedule to define a time schedule for your workflows.
Reference:
https://docs.github.com/en/actions/reference/workflows-and-actions/workflow-syntax
https://docs.github.com/en/actions/reference/workflows-and-actions/events-that-trigger-workflows
質問 # 44
As a developer, which of the following snippets will enable you to run the commands npm ci and npm run build as part of a workflow?
- A. - shell:
npm ci
npm run build - B. - run: |
npm ci
npm run build - C. - run:
npm ci
npm run build - D. - run: |
npm ci
npm run build
shell: nodejs - E. - shell: |
npm ci
npm run build
正解:B
解説:
Use the run: keyword only, not the shell keyword.
Use the special character |.
Note: There are two ways to run commands one after another on Github Actions.
Reference:
https://stackoverflow.com/questions/71047777/how-to-run-two-commands-on-github-actions- instance-one-after-another
質問 # 45
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 }}
- B. run: echo "::set-env name=FOO::bar"
- C. run: echo "FOO=bar" >> $GITHUB_ENV
- D. run: export FOO=bar
正解:C
解説:
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
質問 # 46
What is the smallest scope for an environment variable?
- A. the workflow settings
- B. the workflow env mapping
- C. a step
- D. a job
正解:C
解説:
In GitHub Actions, environment variables can be defined at three different scopes: workflow, job, and step. Each scope determines the visibility and lifetime of the environment variable across the workflow execution.
Variables defined at the workflow scope are available to all jobs and steps within the workflow.
Variables defined at the job scope are available to all steps within a specific job.
Variables defined at the step scope are only available to the step in which they are defined. They are declared within a step and are not visible outside of that step.
Reference:
https://medium.com/@leroyleowdev/github-actions-ways-to-share-data-between-jobs-
4267ff9ac2ce
質問 # 47
Which of the following is the most common way to target a specific major release version?
- A. steps:
- uses: actions/checkout - B. steps:
- uses: actions/checkout@v3 - C. steps:
- uses: actions/checkout@U1673995124 - D. steps:
- uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c
正解:B
解説:
Example: Using versioned actions
steps:
# Reference a specific commit
- uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3
*-> # Reference the major version of a release
- uses: actions/checkout@v4
# Reference a specific version
- uses: actions/[email protected]
# Reference a branch
- uses: actions/checkout@main
Reference:
https://docs.github.com/en/actions/reference/workflows-and-actions/workflow-syntax
質問 # 48
Which files are required for a Docker container action in addition to the source code? (Choose two.)
- A. Dockerfile
- B. metadata.yml
- C. Actionfile
- D. action.yml
正解:A、D
解説:
Dockerfile: The Dockerfile is required for Docker container actions. It defines the environment for the action, specifying the base image, dependencies, and any commands to set up the action's runtime inside the container.
action.yml: The action.yml file is required for all GitHub Actions, including Docker container actions. It contains metadata about the action, including the inputs, outputs, and the runtime environment (which in this case is Docker, defined under runs.using).
質問 # 49
Which workflow command would output the debug message "action successfully debugged"?
- A. echo :debug::message=action successfully debugged"
- B. echo "debug-action successfully debugged"
- C. echo "::debug::action successfully debugged"
- D. echo ":debug:action successfully debugged:"
正解:C
解説:
The ::debug:: syntax is used to output debug messages in GitHub Actions workflows. This command will print the message "action successfully debugged" in the debug logs when the workflow runs.
質問 # 50
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 actions/run-powershell action to invoke the script.
- B. Use the YAML powershell: step.
- C. Run the pwsh2bash command to convert the script so it can be run on Linux.
- D. Configure a self-hosted runner on Windows with the requested tools.
- E. Use the YAML shell: pwsh in a run step.
正解:E
解説:
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.
質問 # 51
As a developer, which workflow steps should you perform to publish an image to the GitHub Container Registry? (Choose three.)
- A. Use the actions/setup-docker action
- B. Push the image to the GitHub Container Registry
- C. Pull the image from the GitHub Container Registry.
- D. Build the container image.
- E. Authenticate to the GitHub Container Registry.
正解:A、B、E
解説:
A . Use the actions/setup-docker action
B . Authenticate to the GitHub Container Registry.
C . Build the container image.
D . Push the image to the GitHub Container Registry
E . Pull the image from the GitHub Container Registry.
質問 # 52
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's repository name includes the keyword "JavaScript."
- D. The action.yml metadata file has the runs.using value set to node16.
正解:B
解説:
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
質問 # 53
Which default GitHub environment variable indicates the owner and repository name?
- A. ENV_REPOSITORY
- B. GITHUB_WORKFLOW_REPO
- C. GITHUB_REPOSITORY
- D. REPOSITORY_NAME
正解:C
解説:
Variables reference
Find information for supported variables, naming conventions, limits, and contexts in GitHub Actions workflows.
Variables include:
* GITHUB_REPOSITORY
The owner and repository name. For example, octocat/Hello-World
* Etc.
Reference:
https://docs.github.com/en/actions/reference/workflows-and-actions/variables
質問 # 54
In which locations can actions be referenced by workflows? (Each correct answer presents a complete solution. Choose three.)
- A. a published Docker container image on Docker Hub
- B. a public NPM registry
- C. the repository's Secrets settings page
- D. the same repository as the workflow
- E. an .action extension file in the repository
- F. a separate public repository
- G. the runs-on: keyword of a workflow file
正解:A、B、F
解説:
Adding an action to your workflow
You can add an action to your workflow by referencing the action in your workflow file. The actions you use in your workflow can be defined in:
[F] The same repository as your workflow file
[C] Any public repository
[B] A published Docker container image on Docker Hub
Note: Adding an action from the same repository [F]
If an action is defined in the same repository where your workflow file uses the action, you can reference the action with either the {owner}/{repo}@{ref} or ./path/to/dir syntax in your workflow file.
Reference:
https://docs.github.com/en/actions/how-tos/write-workflows/choose-what-workflows-do/find-and- customize-actions
質問 # 55
Which GitHub Actions event configuration triggers only for pull requests targeting the release branch and not for push events?
- A. on: pull_request: branches: - release
- B. on: pull_request_target: branches: - release
- C. on: push: branches: - release
- D. on: pull_request: types: - opened
正解:A
解説:
The correct option is on: pull_request: branches: - release. This configuration runs only when a pull request targets the release branch and it does not run on push events.
The pull_request event triggers on pull request activity and the branches filter matches the base branch of the pull request. By specifying the release branch, this configuration limits runs to pull requests that target that branch. Because it listens only for the pull_request event, pushes will not trigger the workflow.
質問 # 56
......
Microsoft練習テストエンジンGH-200問題:https://drive.google.com/open?id=1z6nav9EpjwqFpeZvsFt5CILdrBHjbVIW
試験合格保証有効なMicrosoft GH-200問題集:https://jp.fast2test.com/GH-200-premium-file.html