gh-run
View, list, and manage GitHub Actions runs
TLDR
Interactively select a run to see information about the jobs
Display information about a specific run
Display information about the steps of a job
Display the log of a job
Check a specific workflow and exit with a non-zero status if the run failed
Interactively select an active run and wait until it's done
Display the jobs for a run and wait until it's done
Re-run a specific workflow
SYNOPSIS
gh run
PARAMETERS
list
List recent workflow runs.
view
View a specific workflow run.
download
Download artifacts associated with a workflow run.
watch
Watch a workflow run in real-time.
rerun
Rerun a workflow run.
cancel
Cancel a workflow run.
run
Run a specific workflow. 'workflow' can be the workflow name or workflow file name.
--repo
Specify the repository. Defaults to current repository.
--branch
Specify the branch for which workflows are displayed.
DESCRIPTION
The gh run command allows you to interact with and manage GitHub Actions workflows and workflow runs directly from your terminal.
You can view recent workflow runs, trigger new runs for specific workflows, view logs for individual jobs, and even attempt to run workflows locally for debugging and testing.
This local execution capability is especially useful for identifying issues in your workflow definitions without constantly pushing changes to your repository.
It provides a streamlined workflow for development, debugging, and management of GitHub Actions, making it easier to automate your software development lifecycle.
CAVEATS
Local workflow execution might not perfectly replicate the GitHub Actions environment. Some features or environment variables may differ, especially in regards to secrets and external service integrations. Also, not all workflow functionality can be executed locally.
LOCAL EXECUTION CONSIDERATIONS
When running workflows locally, ensure that your local environment is properly configured with any necessary dependencies, environment variables, and authentication credentials.
Use the --debug flag for more detailed output during local workflow execution.
AUTHENTICATION
Ensure that the gh CLI is properly authenticated with your GitHub account. Use gh auth login to authenticate.
HISTORY
The gh run command was introduced as part of the GitHub CLI (gh) tool to simplify interaction with GitHub Actions from the command line.
Its development reflects the growing adoption of GitHub Actions for CI/CD and automation, providing a more efficient way for developers to manage and debug workflows.