GH-200 practice questions

20 free GH-200 practice questions with answers and explanations, covering workflow authoring, triggers, custom actions, runners, and securing GitHub Actions across an enterprise.

Study the full GH-200 course, free to start.

GH-200 exam at a glance

Skills measured from January 2026

Official GH-200 study guide on Microsoft Learn

20 free GH-200 practice questions

Automate your workflow with GitHub Actions, Part 1 of 2

Question 1. An external content system needs to trigger a site rebuild whenever an editor publishes, passing the page identifier. What should the workflow use?

  1. workflow_run, reading the identifier from github.event.workflow_run
  2. workflow_call, reading the identifier from the inputs context
  3. repository_dispatch, reading the identifier from github.event.inputs
  4. repository_dispatch, reading the identifier from the client_payload
Show answer

Answer: D, repository_dispatch, reading the identifier from the client_payload. repository_dispatch exists for external systems: the caller POSTs an `event_type` and a `client_payload`, the workflow filters on `types:` and reads the payload from `github.event.client_payload`. `github.event.inputs` holds workflow_dispatch inputs, workflow_call can only be invoked by another workflow, and workflow_run fires when another workflow completes.

Question 2. A step must set a value that later steps in the same job read as an environment variable. What should it do?

  1. Write `name=value` to the file at GITHUB_OUTPUT
  2. Use the deprecated `::set-env::` workflow command
  3. Append `name=value` to the file at GITHUB_ENV
  4. Declare it under the job's `env:` block at runtime
Show answer

Answer: C, Append `name=value` to the file at GITHUB_ENV. Appending to `GITHUB_ENV` sets an environment variable for subsequent steps in the same job. `GITHUB_OUTPUT` sets named step outputs read via the `steps` context, `set-env` is deprecated for security reasons, and a job's `env:` block is static rather than runtime.

Question 3. A new starter asks what GitHub Actions are, and whether the team will need to stand up a build server for it. What is the accurate answer?

  1. YAML-defined automation that GitHub runs on hosted runners; self-hosted runners are optional
  2. A hosted container registry that can also run build scripts when an image is pushed
  3. A build server product you install and maintain alongside the repository, like Jenkins
  4. YAML-defined automation that needs a self-hosted runner registered before anything runs
Show answer

Answer: A, YAML-defined automation that GitHub runs on hosted runners; self-hosted runners are optional. There is no server to stand up. Workflows are YAML files in the repository, and GitHub provides the runners. Self-hosted runners exist for cases hosted ones cannot cover, such as custom hardware or access to something on a private network, but they are an option rather than a prerequisite.

Question 4. A teammate re-runs a failed run that you started. Inside the re-run, what does github.actor hold?

  1. Your teammate, as the actor is whoever ran it last
  2. The github-actions bot, as re-runs are automated
  3. Nothing, as actor is empty for any re-run attempt
  4. You, as github.actor keeps the initial run's user
Show answer

Answer: D, You, as github.actor keeps the initial run's user. github.actor is the user who triggered the initial run. On a re-run, github.triggering_actor holds whoever started the re-run, which can differ. Approval logic that trusts github.actor should take that into account.

Question 5. A build job caches its compiled output and the deploy job depends on finding it. A reviewer objects. Why?

  1. Caches can be evicted and are branch-scoped, so deploy may miss it; use an artifact
  2. Caches can only hold package manager directories, so compiled binaries are rejected
  3. Caches are job-scoped, so the deploy job can never restore what build saved
  4. Caches are slower than rebuilding compiled output, so deploy should rebuild it
Show answer

Answer: A, Caches can be evicted and are branch-scoped, so deploy may miss it; use an artifact. Caching is an optimisation, so a job must still work on a miss. Eviction and branch scoping mean the hit is never guaranteed, and handing a build output to a later job is exactly what artifacts exist for.

Question 6. A reviewer asks what continue-on-error: true on a single step actually changes, given that the step still fails. What is the accurate answer?

  1. The step and job still fail, and the setting only hides the error annotation
  2. The step and job still fail, but the run as a whole is reported as successful
  3. The step is marked failed, but later steps run and the job does not fail
  4. The step is skipped silently, and nothing is recorded against it in the log
Show answer

Answer: C, The step is marked failed, but later steps run and the job does not fail. Exit codes normally propagate: a non-zero exit fails the step, stops the rest of the job, fails the job, and skips anything declaring needs: on it. continue-on-error breaks that chain wherever you put it, on a step so the job carries on, or on a job so the run can still be reported as successful. The failure stays visible, it just stops being fatal.

Question 7. A production job waits for approval. A security reviewer asks whether it has read the production environment's secrets yet. What is accurate?

  1. Yes, secrets load when the job is queued, before approval
  2. No, secrets become available only after every protection rule passes
  3. Yes, but they are masked until an approver allows the job
  4. No, environment secrets are read only by the approving user
Show answer

Answer: B, No, secrets become available only after every protection rule passes. Every protection rule must pass before the job is sent to a runner, and the job can read the environment's secrets only after that, which makes the environment a real boundary.

Question 8. A developer with write access asks whether they can delete a run's logs and re-run a workflow. What is accurate?

  1. Only re-running, since deleting logs needs the admin role
  2. Only deleting logs, since re-running needs the maintain role
  3. Neither, as both actions are reserved for organisation owners
  4. Yes to both, as write access covers deleting logs and re-running
Show answer

Answer: D, Yes to both, as write access covers deleting logs and re-running. Write access to the repository is enough to re-run workflows, delete workflow run logs and delete cache entries through the interface. Admin is needed for repository settings, such as debug secrets.

Question 9. An organisation has capped artifact retention at 30 days. A workflow sets retention-days: 90 on an upload step. What happens?

  1. The workflow fails validation, so the job never starts
  2. The artefact is kept for 30 days, the configured maximum
  3. The artefact is kept for 90 days, as the workflow value is more specific
  4. The artefact is kept for 90 days, but is excluded from storage billing
Show answer

Answer: B, The artefact is kept for 30 days, the configured maximum. Per-artifact retention lets one artefact differ from the default, but only downwards: the value has to sit between one day and the maximum configured for the repository, organisation or enterprise. Changing that configured maximum is not retrospective either, so it applies only to objects created afterwards.

Question 10. A GitHub Script automation has grown to eighty lines and is duplicated in three repositories. What should happen?

  1. Convert it into a Docker container action so it runs in isolation
  2. Split it into three shorter GitHub Script steps in the same job
  3. Move it into a JavaScript action that is versioned and shared
  4. Keep it inline, and add comments so the script is easier to read
Show answer

Answer: C, Move it into a JavaScript action that is versioned and shared. GitHub Script suits short, repository-specific chores. Long-lived logic shared across repositories belongs in a JavaScript action, where it can be versioned, published and consumed by all three rather than copied.

Automate your workflow with GitHub Actions, Part 2 of 2

Question 11. A team makes a previously private repository public so outside contributors can read the code. What happens to the package it publishes?

  1. Nothing changes, because the package's visibility is set separately
  2. It follows the repository and becomes public, so check what it contains
  3. It is unpublished and has to be released again from the public repository
  4. It becomes public, but its existing versions remain private
Show answer

Answer: B, It follows the repository and becomes public, so check what it contains. Choosing visibility for a package is not a registry setting of its own: packages inherit the visibility and permissions assigned at the repository level. Opening the repository therefore opens the package, which is exactly what you want when it was intended and a disclosure when it was not.

Question 12. A shared reusable workflow gains a new required input. Twenty callers break the same morning. What practice would have prevented this?

  1. Versioning the shared workflow with tags, and having callers pin to a version
  2. Requiring every caller to pass secrets: inherit when it calls the workflow
  3. Nesting the shared workflow one level deeper inside a wrapper workflow
  4. Converting the shared workflow into a composite action used by each caller
Show answer

Answer: A, Versioning the shared workflow with tags, and having callers pin to a version. Because callers pick up changes immediately, a shared workflow is a published interface: tag versions, avoid breaking input contracts, and let callers pin to a tag or SHA so they migrate deliberately. Nesting and secret handling are unrelated to the breakage.

Question 13. An organisation publishes an action named `github`. GitHub rejects the name. Why?

  1. The name matches the repository owner, so it is reserved for that owner
  2. Marketplace names must start with the publishing organisation's name
  3. A name cannot match another user, organisation, category or GitHub feature
  4. Marketplace names must be at least two words long to avoid collisions
Show answer

Answer: C, A name cannot match another user, organisation, category or GitHub feature. Name uniqueness rules prevent impersonation and confusion: only the GitHub organisation itself could publish an action named `github`, and names may not collide with an existing Marketplace category or GitHub feature.

Question 14. An action is published as an immutable action. What changes for workflows that reference it by version?

  1. Tags are banned, so every reference must become a full commit SHA
  2. A version resolves to a published package that cannot be altered
  3. Only organisations with a Verified creator badge can still use it
  4. Each run downloads the action's latest commit from the default branch
Show answer

Answer: B, A version resolves to a published package that cannot be altered. Immutable actions are published as packages whose released versions cannot be changed or deleted, so a version always points at the same code, unlike a Git tag, which can be moved. Pinning to a full commit SHA remains good practice for actions that are not immutable.

Question 15. A shared actions repository is used by every pipeline in the organisation. What protects it appropriately?

  1. Making the repository public, so every change is visible to everyone
  2. Moving it outside the organisation, so fewer people know it exists
  3. Having consumers reference the default branch, so fixes spread quickly
  4. Branch protection, required reviews, and write access limited to a team
Show answer

Answer: D, Branch protection, required reviews, and write access limited to a team. A shared actions repository is critical infrastructure: a change reaches every consumer. Branch protection, required approvals and restricted write access ensure modifications are reviewed. Pinning consumers to the default branch would make unreviewed changes propagate faster, which is the opposite of what is wanted.

Question 16. An organisation wants to guarantee that a third-party action cannot be swapped for malicious code after review. What achieves this?

  1. Pinning to the major version tag, with Dependabot proposing updates
  2. Forking the action and referencing the fork's default branch instead
  3. Requiring every action to carry a verified creator badge before use
  4. Pinning to a full commit SHA, enforced through the allowed actions policy
Show answer

Answer: D, Pinning to a full commit SHA, enforced through the allowed actions policy. A tag can be moved to different code, so only a full commit SHA is immutable, and organisation policy can require SHA pinning and fail workflows that use floating tags. The Verified badge indicates a verified creator but does not prevent a tag being moved, and a fork's default branch is just as movable.

Question 17. A deployment pipeline verifies an artefact's attestation successfully. What has it established?

  1. That the artefact is safe to deploy into the production environment
  2. That the expected workflow built it, and it has not changed since
  3. That the source code it was built from passed all of its tests
  4. That every dependency inside the artefact is fully up to date
Show answer

Answer: B, That the expected workflow built it, and it has not changed since. Verification confirms origin and integrity, and nothing more. A malicious change committed to the source and built by the expected workflow produces a perfectly valid attestation, which is why verification complements review and scanning rather than replacing them.

Question 18. A deployment job must refuse any artefact it cannot trace back to the organisation's own build. What does it run, and what does that check still leave to you?

  1. A checksum comparison, which leaves managing the signing keys to you
  2. A container image scan, which leaves choosing the base image to you
  3. An SBOM comparison, which leaves reviewing component licences to you
  4. Attestation verification, which leaves the policy and risk call to you
Show answer

Answer: D, Attestation verification, which leaves the policy and risk call to you. Verifying attestations links an artefact to the source code and build instructions that produced it. It does not say the code is good: a verified build of vulnerable code verifies perfectly well. The criteria for acceptable provenance, and the decision to ship, stay with the team.

Question 19. Besides reusable workflows and custom actions, which third kind of reusable component does the enterprise guidance name?

  1. Shared runners that every organisation registers in common
  2. Shared scripts in Bash, PowerShell or Python that workflows call
  3. Shared secrets that every repository inherits by default
  4. Shared branches that every repository merges into weekly
Show answer

Answer: B, Shared scripts in Bash, PowerShell or Python that workflows call. The three kinds are reusable workflows (such as a standard build-and-deploy pipeline), custom actions (such as dependency setup or security checks) and shared scripts (such as a compliance report generator).

Question 20. A secret is referenced directly in an expression inside a run: step. Where can it be exposed on a compromised runner?

  1. Nowhere, as expressions are resolved on GitHub's servers
  2. Only in the masked log, where asterisks protect the value
  3. In the generated shell script, written to disk with the value
  4. Only in the GITHUB_TOKEN, which embeds every secret used
Show answer

Answer: C, In the generated shell script, written to disk with the value. Assigned to an environment variable, a secret is readable by any process on the runner. Referenced in an expression, the generated script holding the resolved value is written to disk. Unreferenced secrets are removed from memory, but used ones and GITHUB_TOKEN remain harvestable.

A 4-week GH-200 study plan

Frequently asked questions

How hard is GH-200?

It rewards people who write workflows regularly. Many questions show YAML and ask what it does or what's wrong with it, so reading workflow files fluently matters as much as knowing the features.

How long should I study for GH-200?

If you already use GitHub Actions, three to four weeks part-time is a reasonable plan. If you're new to it, build a few real workflows alongside your study.

Are these real GH-200 exam questions?

No. Microsoft exam questions are confidential, and sharing them breaks the agreement every candidate accepts. These are original questions written to the published skills outline, so they test the same knowledge in the same style.

Is CertBuddi free?

Yes, completely. Every module of GH-200, the practice questions and the timed mock exam are free for everyone, with no account needed. A free account saves your progress, shows your strengths and weak spots, and lets you set an exam date with a study plan. No card, no trial.

How should I use these practice questions?

Answer each one before you look at the explanation, and keep a list of the ones you get wrong. That list is your study plan: it's made of exactly the things you don't know yet.

CertBuddi is an independent study aid, not affiliated with or endorsed by Microsoft. These are original practice questions, not real exam questions.