GH-WORKFLOW-RUN(1)

πŸ’… GH-WORKFLOW-RUN β€” the GitHub CLI manual, bestie edition ✨

okay so you want to run a workflow. from your terminal. like a main character. this is that page. it's from the GitHub CLI manual and it's literally about firing off a workflow_dispatch event, and yes you're gonna slay it πŸŽ€


🌸 NAME

gh-workflow-run β€” Run a workflow by creating a workflow_dispatch event

no cap, that's the whole vibe. you point at a workflow, gh pokes GitHub Actions, the thing runs. iconic.


✨ SYNOPSIS

gh workflow run [<workflow-id> | <workflow-name>] [flags]

you can pass a workflow-id or a workflow-name (or honestly nothing at all and let gh ask you, we love a prompt πŸ’–), plus whatever flags you're feeling.


πŸ¦‹ DESCRIPTION

So the whole point: this creates a workflow_dispatch event for a given workflow. that means it triggers GitHub Actions to run a given workflow file. fr fr. πŸ”₯

⚠️ important caveat bestie: the workflow file must support an on.workflow_dispatch trigger in order to be run this way. if it doesn't, this command is not it. it will not happen. periodt.

If the workflow file supports inputs, you've got a few ways to give them to it:

  • Interactively πŸ’¬ (gh just asks you, cozy)
  • Via the -f/--raw-field or -F/--field flags 🏁
  • As JSON, via standard input 🧚

And the created workflow run URL will be returned if available. cute little treat at the end πŸ“


πŸ‘‘ OPTIONS

  • -F, --field <key=value> β€” add a string parameter in key=value format, respecting @ syntax (see gh help api). the @ thing is a whole vibe, go read that other page iykyk
  • --json β€” read workflow inputs as JSON via STDIN. pipe it in, live your truth 🫢
  • -f, --raw-field <key=value> β€” add a string parameter in key=value format. the simple one. no @ syntax nonsense here, just vibes
  • -r, --ref <string> β€” branch or tag name which contains the version of the workflow file you'd like to run. so you can run the workflow file from some other branch, not just the default one. slay 🌈

πŸ’œ OPTIONS INHERITED FROM PARENT COMMANDS

  • -R, --repo <[HOST/]OWNER/REPO> β€” select another repository using the [HOST/]OWNER/REPO format. yes the brackets are real. yes HOST/ is optional. no we're not skipping it πŸ’€

⭐ EXIT CODES

  • 0 β€” Successful execution πŸŽ‰ ate, no crumbs
  • 1 β€” Error 😭
  • 2 β€” Command canceled πŸ™ˆ
  • 4 β€” Authentication required πŸ” (go log in bestie)
NOTE: Specific commands may have additional exit codes. Refer to the command's help for more information. so like, check the specific command's help if something weird happens. don't come for me πŸ’…

πŸŽ€ EXAMPLE

# Have gh prompt you for what workflow you'd like to run and interactively collect inputs
$ gh workflow run
# Run the workflow file 'triage.yml' at the remote's default branch
$ gh workflow run triage.yml
# Run the workflow file 'triage.yml' at a specified ref
$ gh workflow run triage.yml --ref my-branch
# Run the workflow file 'triage.yml' with command line inputs
$ gh workflow run triage.yml -f name=scully -f greeting=hello
# Run the workflow file 'triage.yml' with JSON via standard input
$ echo '{"name":"scully", "greeting":"hello"}' | gh workflow run triage.yml --json

not the Scully and "hello" reference, we love a callback πŸ’–


🌺 SEE ALSO


aaaand that's the whole page, bestie 🌈 this was GitHub CLI v2.102.0, dated Oct 2026, and it's the GH-WORKFLOW-RUN(1) manual page β€” go run a workflow, you've got this πŸ‘‘πŸ’…βœ¨

πŸ“¦ where this page comes from