GH-200 - Author and manage workflows (25% of the exam) - Section 1.2

Define and validate workflow_dispatch inputs and pass inputs and secrets to reusable workflows through workflow_call.

Define typed workflow_dispatch inputs and validate their values at trigger time. Pass inputs and secrets to reusable workflows via workflow_call, distinguishing required from optional inputs.

workflow_dispatch inputsworkflow_callinputs and secretsreusable workflow inputs

Practice question for this objective

Free sampleAuthor and manage workflowsmedium

A reusable workflow declares its accepted inputs and secrets under workflow_call, and a caller invokes it with the uses key. The caller must pass a required string input named image_tag and a secret named REGISTRY_TOKEN. Which combination of keys does the caller use to supply these values to the reusable workflow?

jobs:
  deploy:
    uses: octo-org/repo/.github/workflows/deploy.yml@v2
    <keys>
  • APass both image_tag and REGISTRY_TOKEN under a single with map, because inputs and secrets are both delivered to a reusable workflow through the with key.
  • BPass image_tag under an inputs map and REGISTRY_TOKEN under an env map, because the caller mirrors the input and environment blocks of the reusable workflow.
  • CPass image_tag under a with map and REGISTRY_TOKEN under a secrets map at the calling job, matching the input and secret names declared under workflow_call. Correct
  • DPass image_tag under a with map and REGISTRY_TOKEN under a needs map, because needs forwards the calling workflow's secrets into the reusable workflow.
Pass declared inputs to a reusable workflow through with and declared secrets through the secrets map on the calling job. When a job calls a reusable workflow with the uses key, declared inputs are supplied through the with map and declared secrets through the secrets map, with each key matching the names defined under the reusable workflow's workflow_call block. Secrets are deliberately kept out of with so they are handled through their own typed channel, and env or needs do not transport caller-supplied input or secret values.

Why A is wrong: Tempting because with does carry inputs, but secrets are not passed through with. A reusable workflow receives secrets through a separate secrets map, and routing a secret through with would not satisfy its secrets declaration.

Why B is wrong: Tempting because the reusable workflow defines an inputs block, but the caller supplies values through with, not a map literally named inputs, and a secret is passed through secrets rather than through env.

Why C is correct: A caller supplies declared inputs through the with map and declared secrets through the secrets map on the calling job, so each key name matches the workflow_call definitions and the values reach the reusable workflow.

Why D is wrong: Tempting because both keys appear on jobs, but needs only declares job dependencies and ordering. It does not forward secrets, so the secret would never reach the reusable workflow.

See more GH-200 practice questions, answers explained.

Exam traps in Author and manage workflows

Answers that look right on this material and are not. Each one is a distractor from a different question in the GH-200 bank for this domain.

  • Read it through github.event.inputs.log_level, because the workflow_call event payload carries the supplied inputs under the github event object.

    Why it is wrong: Tempting because github.event.inputs holds values for workflow_dispatch, but a reusable workflow called through workflow_call exposes its inputs through the inputs context, not through github.event.inputs.

  • Add DEPLOY_KEY to the caller workflow under a top-level secrets key so the secret is registered before the reusable workflow is invoked

    Why it is wrong: There is no top-level secrets key at workflow scope; secrets are passed per job, so this misremembers the syntax and does not resolve the undeclared-secret error.

  • The caller omitted required: true on retry_count, so the input defaulted to null; adding required: true in the with block fixes the type error

    Why it is wrong: required is declared in the called workflow, not in the caller's with block, and a missing value is not a type mismatch, so this misplaces the fix and the error.

Examworthy is not affiliated with or endorsed by GitHub. Original, blueprint-aligned practice material only.