The debug toolkit
- Re-run with debug logging — UI button on a failed run; or set
ACTIONS_RUNNER_DEBUG=true+ACTIONS_STEP_DEBUG=trueas repo secrets. Logs become 5–10× longer, but you see every API call. - Step debug action —
mxschmitt/action-tmateopens an SSH session to the runner mid-job. Useful (and dangerous — anyone watching the session steals secrets). - Step Summary — append diagnostic info to
$GITHUB_STEP_SUMMARYfrom inside the failing step. - Artifact dumps —
if: always()upload the failure-relevant files (logs, screenshots, env dumps) so you can download and inspect. - Reproduce locally — same image, same env, with act or just Docker.
Common bugs and what surfaces them
- Step is skipped unexpectedly → check the
if:expression; act prints the resolved value. - Secret seems empty → it's not in scope (org / env mismatch) or it's a fork PR.
- Cache never restores → key mismatch; run with debug to see the resolved key string.
- Matrix produces no jobs → empty
fromJSONinput; check upstream job's output. - Self-hosted runner not picking up → label mismatch, runner offline, or runner busy.