.nh .TH "GH-WORKFLOW-RUN" "1" "Oct 2022" "" "GitHub CLI manual" .SH NAME .PP gh-workflow-run - Run a workflow by creating a workflow_dispatch event .SH SYNOPSIS .PP \fB\fCgh workflow run [ | ] [flags]\fR .SH DESCRIPTION .PP Create a workflow_dispatch event for a given workflow. .PP This command will trigger GitHub Actions to run a given workflow file. The given workflow file must support a workflow_dispatch 'on' trigger in order to be run in this way. .PP If the workflow file supports inputs, they can be specified in a few ways: .RS .IP \(bu 2 Interactively .IP \(bu 2 via -f or -F flags .IP \(bu 2 As JSON, via STDIN .RE .SH OPTIONS .TP \fB\fC-F\fR, \fB\fC--field\fR \fB\fC\fR Add a string parameter in key=value format, respecting @ syntax .TP \fB\fC--json\fR Read workflow inputs as JSON via STDIN .TP \fB\fC-f\fR, \fB\fC--raw-field\fR \fB\fC\fR Add a string parameter in key=value format .TP \fB\fC-r\fR, \fB\fC--ref\fR \fB\fC\fR The branch or tag name which contains the version of the workflow file you'd like to run .SH OPTIONS INHERITED FROM PARENT COMMANDS .TP \fB\fC-R\fR, \fB\fC--repo\fR \fB\fC<[HOST/]OWNER/REPO>\fR Select another repository using the [HOST/]OWNER/REPO format .SH EXAMPLE .PP .RS .nf # 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 .fi .RE .SH SEE ALSO .PP \fB\fCgh-workflow(1)\fR