Which GitHub CLI command triggers a workflow_dispatch event from the command line?
Select an answer to reveal the explanation.
Short Explanation and Infographic
gh workflow run triggers a workflow_dispatch event — you can even pass inputs inline with --field flags.
Full explanation below image
Full Explanation
'gh workflow run <workflow-name-or-id>' triggers a workflow that has the 'workflow_dispatch' trigger. You can specify a branch with '--ref main' and pass inputs with '--field key=value' or '--json'. Additional useful gh CLI commands: 'gh run list' to see recent runs, 'gh run view <id>' for details, 'gh run watch <id>' to stream live output, 'gh workflow disable/enable' to toggle workflows. 'gh workflow start' doesn't exist. 'gh actions trigger' isn't a valid command. 'gh run create' doesn't exist. The gh CLI requires authentication and the workflow must have workflow_dispatch defined.