What is `workflow_dispatch`, and what input types does it support?
BeginnerConceptTriggers & Events
Answer
It adds a "Run workflow" button and API endpoint for manual runs on a chosen ref. Inputs support string, boolean, choice, number and environment types, with required, default and description.
on:
workflow_dispatch:
inputs:
environment: { type: environment, required: true }
dry_run: { type: boolean, default: true }
log_level:
type: choice
options: [info, debug]
Read them with inputs.dry_run (typed) rather than github.event.inputs.dry_run (always a string).
More on Triggers & Events
How do you trigger a workflow on pushes to `main` and on PRs that target `main`?BeginnerWhat activity types does `pull_request` trigger on by default, and how do you add more?IntermediateHow do `branches` and `branches-ignore` filters work with globs?BeginnerHow do path filters work, and what are their limits?AdvancedHow do you trigger only on version tags, and what is the gotcha with pushing many tags?IntermediateWhy does `github.event.inputs.dry_run == true` never match, while `inputs.dry_run` works?Intermediate