LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

gh-workflow

Manage GitHub Actions workflows from the command line

TLDR

List workflows
$ gh workflow list
copy
View workflow details
$ gh workflow view [workflow-name]
copy
Run a workflow
$ gh workflow run [workflow-name]
copy
Enable a workflow
$ gh workflow enable [workflow-name]
copy
Disable a workflow
$ gh workflow disable [workflow-name]
copy
Run a workflow with input parameters
$ gh workflow run [workflow-name] -f [key]=[value]
copy
Run a workflow on a specific branch
$ gh workflow run [workflow-name] --ref [branch-name]
copy
View workflow runs in web browser
$ gh workflow view [workflow-name] --web
copy

SYNOPSIS

gh workflow command [options]

DESCRIPTION

gh workflow manages GitHub Actions workflows from the command line. It provides control over workflow definitions including listing, viewing, triggering, and enabling or disabling workflows.The run command triggers workflow_dispatch events, executing workflows on demand with optional input parameters. This enables manual CI runs and parameter-driven workflows from the terminal.

PARAMETERS

list

List workflow files.
view WORKFLOW
View workflow details.
run WORKFLOW
Trigger a workflow run.
enable WORKFLOW
Enable a workflow.
disable WORKFLOW
Disable a workflow.
-r REF, --ref REF
Branch or tag for workflow run.
-f KEY=VALUE
String input parameters for workflow run.
-F KEY=VALUE
Input parameters from file or stdin (use @file or - for stdin).
-w, --web
Open workflow in the web browser.
-a, --all
Include disabled workflows when listing.
-L, --limit N
Maximum number of items to list (default 50).
--json FIELDS
Output results in JSON format with specified fields.

CAVEATS

Workflow must have workflow_dispatch trigger for manual runs. Enable/disable requires admin access. Inputs must match workflow definition.

HISTORY

gh workflow was added to the GitHub CLI as part of comprehensive GitHub Actions integration, enabling complete workflow management from the terminal.

SEE ALSO

gh(1), gh-run(1)

Copied to clipboard
Kai