GH-200 Exam Questions & Answers
GitHub Actions Exam • Microsoft
100% money-back guarantee
Sample GH-200 Questions
Practice with real exam-style questions, each with the verified correct answer and explanation.
What can be used to set a failed status of an action from its code?
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.
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?
The GET /repos/:owner/:repo/actions/runs/:run_id/logs API endpoint is used to retrieve the logs of a specific workflow run identified by run_id. This is the correct method for downloading logs from a workflow run.
As a developer, you are optimizing a GitHub workflow that uses and produces many different files. You need to determine when to use caching versus workflow artifacts. Which two statements are true? (Choose two.)
Caching is ideal for files that change rarely, such as dependencies or build outputs, as it speeds up subsequent workflow runs by reusing previously cached files instead of re-downloading or rebuilding them.
Artifacts are used for persisting files produced during a job that need to be used in later jobs or after the workflow has ended, allowing them to be downloaded or referenced later.
Which of the following is the best way for an enterprise to prevent certain marketplace actions from running?
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.
You are a DevOps engineer working on deployment workflows. You need to execute the deploy job only if the current branch name is feature-branch. Which code snippet will help you to implement the conditional execution of the job?
The correct GitHub Actions context property for the short branch or tag name that triggered the workflow is github.ref_name. A job-level if: condition can use this context to control whether the job runs. Therefore, if: github.ref_name == 'feature-branch' correctly limits the deploy job to the feature-branch branch. The other options use invalid context paths such as github.ref.name, github.branch_name, and github.branch.name; these are not recognized GitHub Actions properties. In exam terms, this question validates knowledge of workflow expressions, GitHub context variables, and conditional job execution. The important distinction is that github.ref contains the full ref path, while github.ref_name provides the branch or tag name directly.
Get access to all 100 verified questions with detailed answers.
Unlock All GH-200 Questions