GH-200 study guide
The domains are in weight order. For YAML questions, check where each key sits before judging what it does. The syntax primer has the full annotated workflow.
Know cold vs. look up later
| Know Cold | Searchable If Needed |
|---|---|
| Five domains and weights | Full list of webhook events and activity types |
.github/workflows/; on: shapes; cron under schedule (UTC, default branch) | Cron edge cases |
workflow_dispatch vs repository_dispatch vs workflow_run vs workflow_call | Payload field names |
needs.<job>.outputs.<x>; GITHUB_OUTPUT / GITHUB_ENV / GITHUB_STEP_SUMMARY | Size limits of env files |
| Matrix: include/exclude, fail-fast (default true), max-parallel | Matrix job cap |
| Cache (reuse, evicted after 7 days idle) vs artifact (keep outputs, 90-day default) | Exact storage quotas |
Action types and action.yml; Marketplace rules | Branding icon names |
| Secret scope precedence env > repo > org; no secrets for fork PRs | REST endpoint paths |
GITHUB_TOKEN vs PAT; permissions:; OIDC id-token: write | Cloud-side trust policy syntax |
| Pin by full SHA; allow-list policies; attestations | SLSA level definitions |
Workflow authoring (20–25%)
| Cue | Answer |
|---|---|
| Manual run with typed inputs | workflow_dispatch + inputs (string, boolean, number, choice, environment) |
| External system triggers a run | repository_dispatch (API) |
| Run after another workflow finishes | workflow_run |
| Reuse a whole workflow | workflow_call; caller uses: owner/repo/.github/workflows/f.yml@ref + with: / secrets: (or inherit) |
| Label-triggered PR deploy on some paths | pull_request: types: [labeled], branches, paths |
Branch name in if: | github.ref_name |
| Job B needs A's value | A: outputs:; B: needs.A.outputs.x |
| Env for later steps | >> $GITHUB_ENV |
| Test DB for the job | services: + health-check options |
| Many OS/version combos | strategy.matrix (+ include/exclude, fail-fast, max-parallel) |
| Repeated mappings in one file | YAML anchors &x + aliases *x (merge keys <<: are not supported) |
| Stop parallel deploys | concurrency: group (+ cancel-in-progress) |
| Human approval | Environment with required reviewers (repo Settings › Environments) |
| Rich report on the run page | $GITHUB_STEP_SUMMARY |
| Env var scopes | workflow env, jobs.<id>.env, step env (step is the smallest) |
Enterprise (20–25%)
| Cue | Answer |
|---|---|
| Specific custom hardware/software runner | Self-hosted + custom labels; runs-on: [self-hosted, label] |
| Restrict who uses runners | Runner groups |
| > 6 h jobs, private network | Self-hosted |
| IP allow list on org | Self-hosted with known IPs or larger runners with static IPs |
| Missing tool on hosted runner | setup-* / package manager / container at runtime; cache it |
| Block Marketplace actions | Allow-list policy (only listed run) |
| Only org-owned actions | "Local actions only" → actions live in org repos |
| Share a secret with chosen repos | Org secret, Selected repositories |
| Standard scaffolds | Workflow templates in org .github repo |
| GHES third-party actions | GitHub Connect or manual actions-sync |
Troubleshooting (15–20%)
- Debug:
ACTIONS_STEP_DEBUG=true(secret or variable) or re-run with debug logging;::debug::lines. - Stuck job on a self-hosted label: runner
_diaglogs; check which runner served the last success. - Download logs:
GET /repos/{owner}/{repo}/actions/runs/{run_id}/logs; artifacts need only read access. - Delete only completed runs. Disable a workflow to stop triggers without deleting the file.
- Matrix failures: the job name shows the axis values; rerun that job or all failed jobs.
- Storage pressure: shorten retention, delete artifacts.
Custom actions (15–20%)
- Composite = bundled shell steps (simplest); JavaScript = code (TypeScript compiles to JS;
core.setFailed); Docker =action.yml+Dockerfile. - Inputs and outputs are declared in
action.yml. Workflow commands:::debug::,::error file=…,line=…::,::add-mask::. - Marketplace: public repo, one action per repo,
action.ymlat root, unique name. - Consumers pin tag (convenient) or SHA (immutable); keep each action in its own repo for independent versioning.
- Test an action with a workflow that runs just that action.
Security (10–15%)
- Untrusted input →
env:then"$VAR"; never${{ github.event.* }}inline inrun:. pull_request_targethas secrets; don't run PR head code in it.permissions:least privilege; GITHUB_TOKEN is per-job and short-lived; PAT only when the token can't do it.- OIDC to the cloud:
id-token: write; no stored cloud secret. - Pin third-party actions to full SHAs; allow-list policies.
- Attestations:
attest-build-provenance(+id-token,attestations: write), verify withgh attestation verify. - Environment secrets unlock after approval; approval waits fail at 30 days.
Traps that look right
| Tempting answer | Why it's wrong |
|---|---|
set-output / set-env | Deprecated; use env files |
github.ref.name / github.branch | Doesn't exist; github.ref_name |
on: cron: | Must be on: schedule: - cron: |
| Environment created in org settings | Environments are repo-level |
shell: nodejs | Not a valid shell |
| Tag pin as "prevents updates" | Tags are mutable; SHA is immutable |
| Hosted runners work with an IP allow list | Only self-hosted or larger (static IP) runners |
Docker action needs metadata.yml | It's action.yml + Dockerfile |
| "GitHub-created actions can't be disabled" | They can |
concurrency: 1 / "mutex" | Not features; concurrency: group |
Secrets in if: | Not allowed directly; map to env |
| Checkout needs an explicit GITHUB_TOKEN | Uses it implicitly |
Decision rules and drills
1. Solve the scope before the syntax
Ask: is this a step, job, workflow, repository, organization, or enterprise requirement? Draw the path the data must follow before selecting an answer.
$GITHUB_ENV: make a value available to subsequent steps in the same job; the writing step does not receive the new value through that mechanism.$GITHUB_OUTPUT: set a step output. Cross-job consumption requires mapping a job output and usingneeds.$GITHUB_STEP_SUMMARY: publish a Markdown job summary.
Drill: explain how a version calculated in job A reaches a deployment step in job B, without relying on a shared shell environment. Workflow commands.
2. Separate the three reuse mechanisms
| Requirement | First mechanism to consider |
|---|---|
| Reuse a group of steps inside a job | Composite action |
| Reuse centrally maintained jobs/workflow logic | Reusable workflow invoked at job level |
| Give teams a starting file they independently edit | Starter workflow/template |
Drill: identify where uses belongs for each. For reusable workflows, trace input, secret, and output mappings. Do not assume environment secrets are passed like ordinary caller secrets: a called job's environment can determine which environment secret is used. Reuse concepts, reusable workflow configuration.
3. Expand matrices on paper
Multiply the base axes, cross out excluded combinations, then inspect each inclusion: it may extend an existing combination or add another. Do not automatically add one job per include entry.
Distinguish max-parallel (simultaneous matrix jobs), fail-fast (cancellation behavior across the matrix), and job-level continue-on-error (tolerance of a particular job's failure).
Drill: use two operating systems and three runtime versions; exclude one pair, then add an extra runtime/OS pair. Write every resulting job before counting. Matrix behavior and examples.
4. Treat runner selection as two questions
Who may use the runner? Runner groups and access policies. Which machine characteristics does the job require? Runner labels and routing.
Drill: explain why a matching label alone does not establish that a repository can access the runner group. Review enterprise policy, private-network requirements, installed tools, and maintenance responsibilities separately. Runner groups, runner labels.
5. Identify the trust boundary in security questions
For every proposed solution, identify whose code executes and which credentials it receives. Running untrusted pull-request code in a privileged pull_request_target workflow is a security trap; changing the trigger alone does not make that code trusted. Official guidance.
For cloud federation, distinguish requesting a GitHub OIDC token from authorization in the cloud. id-token: write permits requesting the token; cloud trust conditions and the assigned cloud role determine access. It does not itself grant write access to cloud resources. OIDC permissions.
Drill: explain the security failure in a workflow before proposing a permission or trigger change.
6. Separate cache restoration from an exact cache hit
A fallback restore can provide files without an exact match to the primary key. Read the ordered restore-keys; existing cache contents cannot be updated in place under the same cache entry. Choose a new key when the cached content must change. Dependency caching reference.
Drill: explain what happens after a dependency lockfile changes, and why a broad fallback cache may still be useful.
7. Debug the right layer
ACTIONS_STEP_DEBUG=true adds step logging. ACTIONS_RUNNER_DEBUG=true adds runner diagnostic logs. These can be configured using a secret or variable; where both exist, the secret wins. Debug logging.
Drill: distinguish a queued job that cannot find an eligible runner from a running job whose shell command failed. Start with runner eligibility for the first, the failing step and logs for the second.
A focused final 90 minutes
This is a suggested final review, not a complete course or a promise of readiness:
- 20 min: enterprise policy, runner groups, secret/variable scopes. Explain the required configuration level aloud.
- 25 min: trace three short workflows: matrix expansion, output passing across jobs, reusable workflow invocation.
- 15 min: review one JavaScript, Docker, and composite action's metadata. Explain how inputs, execution, and outputs connect.
- 15 min: security scenarios: untrusted PR code, token permissions, OIDC trust, action pinning, artifact provenance.
- 15 min: revisit incorrect and lucky answers. For each, write one rule and why the strongest distractor fails.