Microsoft GitHub Actions GH-200 Exam Questions

Page: 1 / 14
Total 72 questions
Question 1

As a developer, you are using a Docker container action in your workflow. What is required for the action to run successfully?



Answer : B

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.


Question 2

Which workflow commands send information from the runner? (Choose two.)



Answer : B, D

Setting a debug message using ::debug:: command sends a message to the logs, helping with troubleshooting and providing insight into the workflow run.

Setting output parameters using ::set-output sends data from a job step to subsequent steps or jobs, which can be used later in the workflow.


Question 3

Which choices represent best practices for publishing actions so that they can be consumed reliably? (Choose two.)



Answer : B, C

Using a tag is a best practice because tags are immutable and represent a fixed version of your action. By referencing tags, consumers of your action can be assured they are using a stable and specific version of the action, which helps in avoiding issues with breaking changes.

The commit SHA is another reliable way to specify a particular version of an action. By referencing a specific commit SHA, consumers can ensure they are using exactly the code that was written at that moment, avoiding the potential for changes in the future.


Question 4

Which workflow command would output the debug message "action successfully debugged"?



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


Question 5

You need to trigger a workflow using the GitHub API for activity that happens outside of GitHub. Which workflow event do you use?



Answer : D

The repository_dispatch event allows you to trigger a workflow in response to external activity. It is commonly used when you need to trigger a workflow from outside GitHub, such as from another system or service, by sending a request to the GitHub API. This event provides flexibility to integrate with various external systems and trigger workflows in a GitHub repository.


Question 6

As a DevOps engineer, you are trying to leverage an organization secret in a repo. The value received in the workflow is not the same as that set in the secret. What is the most likely reason for the difference?



Answer : A

GitHub secrets are defined at different levels: organization, repository, and sometimes at the workflow level. If a secret is defined at both the organization level and the repository level, the repository-level secret will take precedence. So, if the value of the secret differs between these levels, the workflow will use the value from the repository level instead of the organization level.


Question 7

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.)



Answer : A, B

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.


Page:    1 / 14   
Total 72 questions