How do you debug a failing GitHub Actions workflow?
IntermediateConceptGitHub Actions
Answer
Re-run with debug logging (the "Enable debug logging" checkbox, or set secret/variable ACTIONS_STEP_DEBUG=true), lint locally with actionlint, reproduce with act for simple workflows, and add diagnostic steps that print toJSON(github) (never secrets). For runner-side problems, a tmate-style SSH session action can be used on a non-sensitive repo. gh run view <id> --log-failed pulls only failing step logs from the CLI.
More on GitHub Actions
What are workflows, jobs, steps and actions in GitHub Actions?BeginnerWhat events can trigger a workflow?BeginnerWhat is the difference between `pull_request` and `pull_request_target`?AdvancedWhat is a runner, and how do GitHub-hosted and self-hosted runners differ?BeginnerHow do you pass data between steps and between jobs?IntermediateHow does a build matrix work?Intermediate