| name | github-actions |
| description | "Manage GitHub Actions workflows -- trigger runs, view status, manage secrets, and debug failures." |
GitHub Actions
Manage CI/CD workflows via the GitHub CLI.
Environment Variables
GITHUB_TOKEN - GitHub personal access token (or use gh auth login)
List workflows
gh workflow list
View workflow runs
gh run list --limit 10
View run details
gh run view 12345678
View run logs
gh run view 12345678 --log | tail -100
View failed run logs
gh run view 12345678 --log-failed
Trigger workflow dispatch
gh workflow run deploy.yml --ref main -f environment=staging -f version=1.2.3
Re-run failed jobs
gh run rerun 12345678 --failed
Cancel run
gh run cancel 12345678
List workflow runs (filtered)
gh run list --workflow=ci.yml --status=failure --limit 5
Watch run in progress
gh run watch 12345678
Manage secrets
gh secret list
gh secret set MY_SECRET --body "secret-value"
gh secret delete MY_SECRET
Manage variables
gh variable list
gh variable set MY_VAR --body "value"
List environments
gh api repos/{owner}/{repo}/environments | jq '.environments[] | {name, protection_rules}'
Download artifacts
gh run download 12345678 --dir /tmp/artifacts
Workflow file reference
Notes
gh uses the current repo context; run from within a git repo or use --repo owner/repo.
- Workflow dispatch requires the workflow to define
workflow_dispatch trigger.
- Confirm before triggering workflows, setting secrets, or cancelling runs.