GitHub CLI Issues and Actions

Issue triage plus GitHub Actions workflows, runs, secrets, variables, and caches.

View
StandardDetailedCompact
Export
Copy the compact sheet, download it, or print it.
Download
`D` dense toggle · `C` copy all
## Issues
List issues
gh issue list

# List open issues.

View an issue
gh issue view 123

# Show issue details.

Create an issue
gh issue create --title "Bug: login fails" --body "Steps to reproduce..."

# Create an issue with title and body.

Create issue with labels and assignee
gh issue create --title "Upgrade Node" --label tech-debt --assignee @me

# Create an issue with metadata.

Edit an issue
gh issue edit 123 --add-label bug --remove-label needs-triage

# Edit issue labels, assignees, and milestone.

Comment on an issue
gh issue comment 123 --body "Investigating now."

# Add an issue comment.

Close an issue
gh issue close 123 --comment "Fixed in #456"

# Close an issue and leave a comment.

Reopen an issue
gh issue reopen 123

# Reopen a closed issue.

Pin an issue
gh issue pin 123

# Pin an issue in the repository.

Unpin an issue
gh issue unpin 123

# Unpin a previously pinned issue.

Lock an issue
gh issue lock 123 --reason resolved

# Lock issue conversation.

Unlock an issue
gh issue unlock 123

# Unlock issue conversation.

Show issue status
gh issue status

# Show issues assigned to you, mentioned, or created by you.

Create a label
gh label create "customer-impact" --color FF0000 --description "Affects customers"

# Create a repository label.

Clone labels from another repo
gh label clone octo-org/source-repo

# Copy labels from another repository.

Delete a label
gh label delete "old-label" --yes

# Delete a label without prompting.

## GitHub Actions and Workflows
List workflows
gh workflow list

# List workflows in the current repository.

View workflow details
gh workflow view "CI"

# Show details for a workflow.

Trigger a workflow
gh workflow run deploy.yml -f environment=staging

# Dispatch a workflow with inputs.

Enable a workflow
gh workflow enable deploy.yml

# Enable a disabled workflow.

Disable a workflow
gh workflow disable deploy.yml

# Disable a workflow.

List workflow runs
gh run list --limit 50

# List recent workflow runs.

View a run
gh run view 123456789

# Show status and jobs for a workflow run.

View run log
gh run view 123456789 --log

# Print logs for a workflow run.

Watch a run live
gh run watch 123456789

# Follow a workflow run until completion.

Download run artifacts
gh run download 123456789 -D ./artifacts

# Download artifacts for a workflow run.

Rerun failed jobs
gh run rerun 123456789 --failed

# Rerun failed jobs from a workflow run.

Cancel a run
gh run cancel 123456789

# Cancel an in-progress workflow run.

List Actions caches
gh cache list

# List GitHub Actions caches.

Delete an Actions cache
gh cache delete my-key

# Delete an Actions cache by key.

List repo secrets
gh secret list

# List Actions secrets for the repo.

Set repo secret
gh secret set AWS_ACCESS_KEY_ID < aws_access_key_id.txt

# Create or update a repository secret from stdin.

List Actions variables
gh variable list

# List repository variables.

Set repository variable
gh variable set APP_ENV --body production

# Create or update a repository variable.

Recommended next

No recommendations yet.