GitHub CLI 2 cheatsheet
GitHub CLI 2: Actions and releases
9 common GitHub CLI 2 tasks.
See why a run failed
Print the logs of the failed steps of a run.
gh run view 123456789 --log-failed
Trigger a workflow
Start a workflow that has a workflow_dispatch trigger.
gh workflow run deploy.yml --ref main
Create a release
Create a release for a tag with generated notes.
gh release create v1.0.0 --generate-notes
Set a repository secret
Store a secret for GitHub Actions. You are prompted for the value.
gh secret set API_KEY
Call the GitHub API
Make an authenticated API request. {owner} and {repo} are filled in from the current repository.
gh api repos/{owner}/{repo}/issues
Create a shortcut
Define an alias, here for listing your open PRs.
gh alias set mine 'pr list --author @me'