An engineer needs to let teammates start a release workflow on demand from the Actions tab and have them choose a deployment environment from a typed field when they do. Which trigger configuration meets both requirements?
on:
<trigger>:
inputs:
environment:
type: choice
options: [staging, production]- Aschedule, with an inputs block listing the environment choices, so the run is launched on demand and reads the selected value.
- Bworkflow_dispatch, because it adds a manual run button in the Actions tab and supports an inputs block including typed choice fields. Correct
- Cpush, with branch filters mapped to the inputs choices, so pushing to a branch starts the run and selects the matching environment.
- Drepository_dispatch, because it shows a manual button in the Actions tab and exposes the same inputs choices to the person starting the run.
Why A is wrong: Tempting because inputs look plausible under any event, but schedule fires only on a cron timer, offers no manual launch button, and does not accept an inputs block at all.
Why B is correct: The workflow_dispatch event enables a manual run control in the Actions tab and accepts an inputs block, so a choice-typed environment field is presented for the operator to select before the run.
Why C is wrong: Tempting because push starts runs from developer activity, but it fires automatically on commits rather than on demand and provides no typed input prompt for the operator to choose an environment.
Why D is wrong: Tempting because it is also manually driven, but repository_dispatch is started by an API call carrying a client_payload, not by an Actions tab button, and it does not render a typed inputs form.