Linux command
gh-workflow 命令
文本
复制后可按需替换文件名、目录或参数。
常用示例
List workflows
gh workflow list
View workflow details
gh workflow view [workflow-name]
Run a workflow
gh workflow run [workflow-name]
Enable a workflow
gh workflow enable [workflow-name]
Disable a workflow
gh workflow disable [workflow-name]
Run a workflow with input parameters
gh workflow run [workflow-name] -f [key]=[value]
Run a workflow on a specific branch
gh workflow run [workflow-name] --ref [branch-name]
View workflow runs in web browser
gh workflow view [workflow-name] --web
说明
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.
参数
- 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.
FAQ
What is the gh-workflow command used for?
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.
How do I run a basic gh-workflow example?
Run `gh workflow list` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does list do in gh-workflow?
List workflow files.