Dispatch a workflow file from the CLI.

Section: Artifacts and GitHub CLI

Trigger a workflow manually with gh

bash
bash
gh workflow run deploy.yml -f environment=staging
Explanation

The target workflow must define the `workflow_dispatch` trigger and compatible inputs.

Learn the surrounding workflow

Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.

Related commands

Same sheet · prioritizing Artifacts and GitHub CLI
List workflows with GitHub CLI
Inspect workflows from the terminal.
OpenIn sheetbashsame section
Watch a workflow run
Stream progress of the latest run in the terminal.
OpenIn sheetbashsame section
Download workflow artifacts with gh
Fetch artifacts from a completed workflow run.
OpenIn sheetbashsame section
Upload build output as an artifact
Save files from the workflow run for later download or later jobs.
OpenIn sheetyamlsame section
Download a prior artifact
Fetch an artifact in a later job.
OpenIn sheetyamlsame section
Cache npm dependencies with setup-node
Use built-in npm cache support.