gh workflow run build.yml --ref main

Category: GitHub CLI

gh workflow run build.yml --ref main

Manually trigger a workflow on a branch

Dispatches a workflow_dispatch run of build.yml, and --ref selects the branch or tag the workflow runs against. Only workflows with a workflow_dispatch trigger accept manual runs. Use this to kick off builds without pushing a commit.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.