Docs

ghdebug runs your GitHub Actions workflows locally with nektos/act. When a run: step fails, the job pauses and you get a shell inside the container, with the same working directory and environment the step had.

Install

You need Docker (running), act 0.2.60 or later, and Python 3.9+.

pipx install git+https://github.com/oiwdis/ghdebug.git
ghdebug --version

Or from a clone: pip install .. If you have not set platforms in ~/.actrc, ghdebug maps ubuntu-latest to catthehacker/ubuntu:act-latest (about 1.6 GB on first pull).

30-second demo

git clone https://github.com/oiwdis/ghdebug.git
cd ghdebug/examples/demo-repo
ghdebug steps          # list the numbered steps
ghdebug run            # step 4 "Test" fails, then a shell opens
#   inside the shell:
#     showstep
#     echo $BUILD_ID
#     sed -i 's/Hello world/hello, world/' greet.sh && rerun
#     exit, then press r
# the workflow finishes green

After fixing the code on your machine instead:

sed -i 's/Hello world/hello, world/' greet.sh
ghdebug run --from-step 4
git checkout greet.sh    # put the demo bug back

Commands

CommandWhat it does
ghdebug run [event]Run the workflow with act and pause on a failing run: step. event defaults to push.
ghdebug run --from-step N -j JOBSkip steps before N. Reuses the kept container and restores $GITHUB_ENV / $GITHUB_PATH from the last run.
ghdebug run --no-pausePlain act behaviour. The container is still kept for ghdebug shell.
ghdebug run --no-shellOn failure, ask retry / continue / fail without opening a shell first.
ghdebug run -- <act args>Anything after -- goes to act, for example -- --secret-file .secrets.
ghdebug stepsList jobs and step numbers.
ghdebug shell [-j JOB] [--step N]Open a shell in a kept job container, with env and cwd as of step N.
ghdebug cleanRemove the containers act and ghdebug kept.

-W path/to/workflow.yml picks a workflow when the repo has more than one. -j job picks a job. For scripts and CI, set GHDEBUG_ON_RESUME=retry|continue|fail to answer the resume prompt automatically.

Limitations

The full README lives in the GitHub repository.