GitHub GH-200 sample questions with explanations, traps, topic labels, and IT Mastery route links.
These original sample questions are designed to help you check how the exam topics appear in decision-style prompts. They are not taken from the live exam.
Use these sample questions as a guided self-assessment for GitHub Actions (GH-200) topics such as workflow triggers, jobs, steps, runners, caching, artifacts, environments, approvals, permissions, secrets, OIDC, reusable workflows, and troubleshooting. The prompts focus on secure automation design and failure diagnosis.
The sample set below is part of the GitHub Actions GH-200 guide path:
Work through each prompt before opening the explanation. Strong answers usually identify the event, permissions, dependency, runner, or environment boundary before changing YAML.
Topic: Protecting deployments with environments
A repository deploys to production from a workflow after tests pass. The team needs manual approval from a release owner before production credentials are available to the job. What should the workflow use?
Best answer: B
Explanation: Environments are designed for deployment gates. Required reviewers can approve the job, and environment-scoped secrets become available only after the environment rules are satisfied.
Why the other choices are weaker:
What this tests: Using environments, required reviewers, and scoped secrets for controlled deployments.
Related topics: Environments; Approvals; Secrets; Deployment
Topic: Avoiding secrets in pull requests
A workflow runs on pull requests from forks. The workflow executes untrusted contributor code. The maintainers want to prevent cloud credentials from being exposed while still running basic tests. Which approach is safest?
pull_request_target for all jobs and immediately check out the contributor’s branch before running scripts with secrets.Best answer: C
Explanation: Untrusted code should not receive privileged credentials. Basic validation can run without secrets, while deploy or cloud steps should run only from trusted branches, environments, or reviewed workflows.
Why the other choices are weaker:
What this tests: Pull request security, secret exposure risk, and trusted-event separation.
Related topics: Pull requests; Forks; Secrets; Workflow security
Topic: Using OIDC for cloud access
A team wants GitHub Actions to deploy to a cloud provider without storing long-lived cloud keys as repository secrets. What design best matches that goal?
Best answer: D
Explanation: OIDC lets the workflow exchange an identity token for short-lived credentials when the cloud trust policy matches the intended repository and context. That avoids storing static keys in GitHub secrets.
Why the other choices are weaker:
What this tests: OIDC federation, short-lived credentials, and secure deployment authentication.
Related topics: OIDC; Cloud credentials; Least privilege; Deployment security
Topic: Troubleshooting skipped jobs
A workflow has build, test, and deploy jobs. The deploy job is skipped even though build succeeds. The workflow uses needs: test, and the test job has an if condition that evaluates to false for documentation-only changes. What is the best first explanation?
Best answer: C
Explanation: Job dependencies matter. If deploy needs test and test is skipped by condition, deploy will not proceed as if the dependency completed successfully.
Why the other choices are weaker:
What this tests: Reading job dependencies, conditions, skipped jobs, and workflow execution flow.
Related topics: Job dependencies; if conditions; Troubleshooting; needs
Tech Exam Lexicon and IT Mastery are independent study tools. They are not affiliated with, endorsed by, or sponsored by GitHub or any certification body.