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.
Official GH-200 study guide on Microsoft Learn
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?
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?
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?
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?
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?
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?
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?
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?
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?
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?
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.
Question 11. A team makes a previously private repository public so outside contributors can read the code. What happens to the package it publishes?
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?
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?
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?
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?
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?
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?
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?
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?
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?
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.
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.
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.
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.
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.
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.