Actions Debug Workflow
Intermediate10 minTrending
Debug failing GitHub Actions workflows by viewing logs, re-running with debug logging, and testing locally.
Prerequisites
- -GitHub CLI (gh) installed and authenticated
Steps
1
List recent workflow runs
View the status of recent workflow runs.
$ gh run list --limit 10
2
View logs for a failed run
Download and view the full logs from a specific workflow run.
$ gh run view <run-id> --log-failed
Use --log-failed to see only the logs from failed steps, which is usually all you need.
3
Re-run failed jobs with debug logging
Re-run only the failed jobs with debug logging enabled for more verbose output.
$ gh run rerun <run-id> --failed --debug
4
Watch a running workflow in real time
Stream the output of a currently running workflow.
$ gh run watch
This is great for watching a run you just triggered without switching to the browser.
5
Trigger a workflow manually
Start a workflow_dispatch workflow from the command line.
$ gh workflow run deploy.yml --ref main -f environment=staging
Full Script
FAQ
Discussion
Loading comments...