Interview Prep/GitHub Actions/Triggers & Events

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).

All GitHub Actions questions Roadmap: GitHub Actions

More on Triggers & Events