
[2025年12月23日] 365日更新、有効なGH-200知能問題集
ベスト品質のGH-200試験問題集でMicrosoftテスト高得点を目指そう
Microsoft GH-200 認定試験の出題範囲:
| トピック | 出題範囲 |
|---|---|
| トピック 1 |
|
| トピック 2 |
|
| トピック 3 |
|
| トピック 4 |
|
質問 # 26
How should you print a debug message in your workflow?
- A. echo "::debug::Set variable myVariable to true"
- B. echo "::add-mask::Set variable myVariable to true"
- C. echo "debug_message=Set variable myVariable to true" >> &GITHUB_OUTPUT
- D. echo "Set variable MyVariable to true" >> $DEBUG_MESSAGE
正解:A
解説:
Example: Setting a debug message
echo "::debug::Set the Octocat variable"
Reference:
https://docs.github.com/en/actions/reference/workflows-and-actions/workflow-commands
質問 # 27
As a developer, you need to use GitHub Actions to deploy a microservice that requires runtime access to a secure token. This token is used by a variety of other microservices managed by different teams in different repos. To minimize management overhead and ensure the token is secure, which mechanisms should you use to store and access the token? (Each correct answer presents a complete solution. Choose two.)
- A. Store the token as a GitHub encrypted secret in the same repo as the code. During deployment, use GitHub Actions to store the secret in an environment variable that can be accessed at runtime.
- B. Store the token in a configuration file in a private repository. Use GitHub Actions to deploy the configuration file to the runtime environment.
- C. Store the token as a GitHub encrypted secret in the same repo as the code. Create a reusable custom GitHub Action to access the token by the microservice at runtime.
- D. Store the token as an organizational-level encrypted secret in GitHub. During deployment, use GitHub Actions to store the secret in an environment variable that can be accessed at runtime.
- E. Use a corporate non-GitHub secret store (e.g., HashiCorp Vault) to store the token. During deployment, use GitHub Actions to store the secret in an environment variable that can be accessed at runtime.
正解:D、E
解説:
[B] Using a corporate secret store like HashiCorp Vault provides a secure, centralized location for sensitive information. GitHub Actions can then retrieve and store the token securely during deployment by setting it as an environment variable, ensuring the token remains secure and accessible at runtime.
[C] Storing the token as an organizational-level encrypted secret in GitHub ensures it is accessible across multiple repositories, minimizing management overhead. GitHub Actions can then use this secret during deployment by setting it as an environment variable, allowing the microservice to access it securely at runtime.
質問 # 28
By default, which workflows can use an action stored in internal repository? (Each answer presents a complete solution. Choose two.)
- A. private repositories owned by an organization of the enterprise
- B. selected public repositories outside of the enterprise
- C. internal repositories owned by the same organization as the enterprise
- D. public repositories owned by the same organization as the enterprise
正解:A、C
解説:
Any actions or reusable workflows stored in the internal or private repository can be used in workflows defined in other internal or private repositories owned by the same organization, or by any organization owned by the enterprise.
Reference:
https://docs.github.com/actions/creating-actions/sharing-actions-and-workflows-with-your- enterprise
質問 # 29
What can be used to set a failed status of an action from its code?
- A. Dockerfile CMD
- B. JavaScript dist/ folder
- C. a non-zero exit code
- D. composite run step
- E. output variable
- F. @actions/github toolkit
正解:C
解説:
Setting exit codes for actions
You can use exit codes to set the status of an action. GitHub displays statuses to indicate passing or failing actions.
About exit codes
GitHub uses the exit code to set the action's check run status, which can be success or failure.
* Exit status: 0
Check run status: success
The action completed successfully and other tasks that depend on it can begin.
* Exit status: Nonzero value (any integer but 0)
Check run status: failure
Any other exit code indicates the action failed. When an action fails, all concurrent actions are canceled and future actions are skipped. The check run and check suite both get a failure status.
Reference:
https://docs.github.com/en/actions/how-tos/create-and-publish-actions/set-exit-codes
質問 # 30
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. the same repository as the workflow
- C. the repository's Secrets settings page
- D. a public NPM registry
- E. the runs-on: keyword of a workflow file
- F. an .action extension file in the repository
- G. a separate public repository
正解:A、D、G
解説:
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
質問 # 31
How can a workflow deploy mitigate the risk of multiple workflow runs that are deploying to a single cloud environment simultaneously? (Each correct answer presents part of the solution.
Choose two.)
- A. Pass the mutex into the deployment job.
- B. Configure the mutex setting in the environment.
- C. Specify a target environment in the deploymentjob.
- D. Set the concurrency in the deploymentjob to 1.
- E. Reference the mutex in the task performing the deployment.
- F. Specify a concurrency scope in the workflow.
正解:C、F
解説:
[D] GitHub Actions now supports a concurrency key at both the workflow and job level that will ensure that only a single run or job is in progress.
concurrency
Use concurrency to ensure that only a single job or workflow using the same concurrency group will run at a time.
Example: Using concurrency and the default behavior
The default behavior of GitHub Actions is to allow multiple jobs or workflow runs to run concurrently. The concurrency keyword allows you to control the concurrency of workflow runs.
Reference:
https://github.blog/changelog/2021-04-19-github-actions-limit-workflow-run-or-job-concurrency/
https://docs.github.com/en/actions/reference/workflows-and-actions/workflow-syntax#concurrency
https://github.com/marketplace/actions/actions-mutex
質問 # 32
How can a workflow deploy mitigate the risk of multiple workflow runs that are deploying to a single cloud environment simultaneously? (Each correct answer presents part of the solution.
Choose two.)
- A. Pass the mutex into the deployment job.
- B. Configure the mutex setting in the environment.
- C. Specify a target environment in the deploymentjob.
- D. Set the concurrency in the deploymentjob to 1.
- E. Reference the mutex in the task performing the deployment.
- F. Specify a concurrency scope in the workflow.
正解:C、F
解説:
[D] GitHub Actions now supports a concurrency key at both the workflow and job level that will ensure that only a single run or job is in progress.
concurrency
Use concurrency to ensure that only a single job or workflow using the same concurrency group will run at a time.
Example: Using concurrency and the default behavior
The default behavior of GitHub Actions is to allow multiple jobs or workflow runs to run concurrently. The concurrency keyword allows you to control the concurrency of workflow runs.
Reference:
https://github.blog/changelog/2021-04-19-github-actions-limit-workflow-run-or-job-concurrency/
https://docs.github.com/en/actions/reference/workflows-and-actions/workflow-syntax#concurrency
https://github.com/marketplace/actions/actions-mutex
質問 # 33
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. Build the container image.
- C. Authenticate to the GitHub Container Registry.
- D. Push the image to the GitHub Container Registry
- E. Pull the image from the GitHub Container Registry.
正解:A、C、D
解説:
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.
質問 # 34
You are a DevOps engineer working on custom Actions development. You need to handle the errors or exceptions as part of the JavaScript based action code. What should be added to the following code block to handle errors?
const core = require('@actions/core');
try {
// action code
} catch (error) {
<< insert snippet here >>
}
- A. core.action.setException(error.message);
- B. action.setError(error.message);
- C. core.setFailed(error.message);
- D. core.setException(error.message);
正解:C
解説:
Setting a failure exit code in a JavaScript action
If you are creating a JavaScript action, you can use the actions toolkit @actions/core package to log a message and set a failure exit code. For example:
try {
// something
} catch (error) {
core.setFailed(error.message);
}
Reference:
https://docs.github.com/en/actions/how-tos/create-and-publish-actions/set-exit-codes
質問 # 35
Without the need to use additional infrastructure, what is the simplest and most maintainable method for configuring a workflow job to provide access to an empty PostgreSQL database?
- A. Dynamically provision and deprovision an environment.
- B. It is currently impossible to access the database with GitHub Actions.
- C. Use service containers with a Postgres database from Docker hub.
- D. Run the actions/postgres action in a parallel job.
正解:C
解説:
GitHub Actions supports the use of service containers, which allows you to spin up a PostgreSQL database (or any other service) in a Docker container during your workflow. You can pull a PostgreSQL image from Docker Hub, and the container will automatically be available to your workflow job. This method requires no additional infrastructure and is easy to configure and maintain, as you simply define the container in the workflow file.
質問 # 36
Which workflow event is used to manually trigger a workflow run?
- A. create
- B. workflow_run
- C. status
- D. workflow_dispatch
正解:D
解説:
Manually running a workflow
When a workflow is configured to run on the workflow_dispatch event, you can run the workflow using the Actions tab on GitHub, GitHub CLI, or the REST API.
Configuring a workflow to run manually
To run a workflow manually, the workflow must be configured to run on the workflow_dispatch event.
To trigger the workflow_dispatch event, your workflow must be in the default branch.
Reference:
https://docs.github.com/en/actions/how-tos/manage-workflow-runs/manually-run-a-workflow
質問 # 37
Which of the following is the proper syntax to specify a custom environment variable named MY_VARIABLE with the value my-value?
- A. environment:
MY_VARIABLE = my-value - B. var:
MY_VARIABLE = my-value - C. env:
MY_VARIABLE = my-value - D. env:
MY_VARIABLE: my-value - E. var:
MY_VARIABLE: my-value - F. environment:
MY_VARIABLE: my-value
正解:D
解説:
To set a custom environment variable for a single workflow, you can define it using the env key in the workflow file.
Example:
env:
DAY_OF_WEEK: Monday
Note: 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:
The entire workflow, by using env at the top level of the workflow file.
The contents of a job within a workflow, by using jobs.<job_id>.env.
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
質問 # 38
In GitHub Actions, where should you declare custom environment variables so they are accessible across all jobs and steps in a single workflow run?
- A. Repository variables
- B. Set env in the workflow YAML
- C. Environment secrets
- D. Runner command line arguments
正解:B
解説:
The correct option is Set env in the workflow YAML because defining environment variables at the top level of a workflow makes them available to every job and step in that single run.
In a workflow file you can declare a top level mapping for environment variables with key value pairs. This top level scope propagates the values to all jobs and steps in the run and you can override them at job or step scope when necessary. This is the most direct way to share non secret configuration across the entire workflow execution.
質問 # 39
As a developer, how can you identify a composite action on GitHub?
- A. The action's repository includes an init.sh file in the root directory.
- B. The action's repository name includes the keyword "composite."
- C. The action.yml metadata file has the runs.using value set to composite.
- D. The action's repository includes Dockerfile and package.json files.
正解:C
解説:
runs.using for composite actions
Required: You must set this value to 'composite'.
Reference:
https://docs.github.com/en/actions/reference/workflows-and-actions/metadata-syntax
質問 # 40
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
shell: nodejs - C. - shell:
npm ci
npm run build - D. - run:
npm ci
npm run build - E. - run: |
npm ci
npm run build
正解:E
解説:
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
質問 # 41
How can GitHub Actions encrypted secrets be used in if: conditionals within a workflow job?
- A. 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.
- B. Create a job dependency that exposes the encrypted secret as a job output, which can then be leveraged in a subsequent dependent job.
- C. Use the secrets context within the conditional statement, e.g. ${{ secrets.MySuperSecret }}.
- D. Set the encrypted secret as a job-level environment variable and then reference the environment variable within the conditional statement.
正解:C
解説:
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.
質問 # 42
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 deployment webhook event as a trigger for the workflow when the code quality integration is completed
- D. Add the pull_request webhook event as a trigger for the workflow when the code quality integration is synchronized
正解:B
解説:
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.
Reference:
https://docs.github.com/en/actions/reference/workflows-and-actions/events-that-trigger-workflows
質問 # 43
Which of the following is the lowest repository permission you need to have for downloading workflow artifacts?
- A. Admin
- B. Triage
- C. Maintain
- D. Read
- E. Write
正解:D
解説:
Downloading workflow artifacts
You can download archived artifacts before they automatically expire.
Who can use this feature?
People who are signed into GitHub and have read access to a repository can download workflow artifacts.
Reference:
https://docs.github.com/en/actions/how-tos/manage-workflow-runs/download-workflow-artifacts
質問 # 44
You need to create new workflows to deploy to an unfamiliar cloud provider. What is the fastest and safest way to begin?
- A. Use the actions/jenkins-plugin action to utilize an existing Jenkins plugin for the cloud provider.
- B. Create a custom action to wrap the cloud provider's CLI.
- C. Search GitHub Marketplace for verified actions published by the cloud provider.
- D. Download the CLI for the cloud provider and review the associated documentation.
- E. Search GitHub Marketplace for actions created by GitHub.
正解: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.
質問 # 45
Which command can you include in your workflow file to set the output parameter for an action?
- A. echo "action_color=purple" >> $GITHUB_ENV
- B. echo "::debug::action_color=purple"
- C. echo "action_color=purple" >> $GITHUB_OUTPUT
- D. echo "::add-mask::$ACTI0N_C0L0R"
正解:C
解説:
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
質問 # 46
In GitHub Actions, how is the success or failure of a step determined by its exit code?
- A. Exit codes are ignored and a maintainer sets the result manually
- B. Zero exit code means success and any nonzero means failure
- C. Success is controlled by continue-on-error rather than the exit code
- D. Every exit code is a failure
正解:B
解説:
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.
質問 # 47
You need to make a script to retrieve workflow run logs via the API. Which is the correct API to download a workflow run log?
- A. POST /repos/:owner/:repo/actions/runs/:run_id
- B. GET /repos/:owner/:repo/actions/runs/:run_id/logs
- C. GET /repos/:owner/:repo/actions/artifacts/logs
- D. POST /repos/:owner/:repo/actions/runs/:run_id/logs
正解:B
解説:
REST API endpoints for workflow jobs
You can use the REST API to view logs and workflow jobs in GitHub Actions.
Download job logs for a workflow run
Gets a redirect URL to download a plain text file of logs for a workflow job.
Code samples for "Download job logs for a workflow run"
Request example
Get /repos/{owner}/{repo}/actions/jobs/{job_id}/logs
Reference:
https://docs.github.com/en/rest/actions/workflow-jobs
質問 # 48
Which of the following is the best way for an enterprise to prevent certain marketplace actions from running?
- A. Create a list of the actions that are restricted from being used as an enterprise policy. Every other action can be run.
- B. Create a list of the actions that are allowed to run as an enterprise policy. Only these actions can be run.
- C. It is not possible; if an action is in the marketplace, its use cannot be restricted.
- D. Create a list that is maintained as a . yml file in a . github repository specified in the enterprise. Only these actions can be run.
正解:B
解説:
The best way for an enterprise to control which GitHub Actions run is by creating a list of approved actions as an enterprise policy. This approach restricts workflows to only use the actions that are explicitly allowed, ensuring security and compliance within the organization.
質問 # 49
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 > Load workflow
- B. Workflow > New workflow
- C. Actions > Load workflow
- D. Actions > New workflow
正解:D
解説:
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.
質問 # 50
Custom environment variables can be defined at multiple levels within a workflow file including:
(Each answer presents a complete solution. Choose three.)
- A. step level.
- B. default level.
- C. job level.
- D. stage level.
- E. runner level.
- F. top level.
正解:A、C、F
解説:
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:
The entire workflow, by using env at the top level of the workflow file.
The contents of a job within a workflow, by using jobs.<job_id>.env.
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
質問 # 51
......
注目すべき時短になるGH-200オールインワン試験ガイド:https://jp.fast2test.com/GH-200-premium-file.html
検証された材料は決まってこれ!GH-200:https://drive.google.com/open?id=1AiI4dlNVxp6ToK_hO5D-TKbipr6QGbke