You implement a manual deploy workflow with workflow_dispatch. Operators must pick the target environment from staging or production. Which input definition is most appropriate?
Select an answer to reveal the explanation.
Short Explanation and Infographic
type: choice gives a dropdown of allowed environments for manual runs. That prevents free-text typos like prodution and documents valid deployment targets clearly.
Full explanation below image
Full Explanation
workflow_dispatch inputs of type choice render a dropdown constrained to declared options, ideal for environment selection. type: environment is a valid input type that lists GitHub Environments, which can also be appropriate when you want the UI tied to configured environments — but the option that says type: environment only without any name is incomplete and invalid as stated. Secrets should not be used as environment pickers. Matrices are for combinatorial jobs, not a substitute for a manual choice input. After selection, use the input in job environment: name: ${{ inputs.target }} and rely on environment protection rules for production. Pair with required reviewers on the production environment for safer manual deploys.