Skip to main content

A local breakpoint debugger for GitHub Actions workflows, wrapping act.

Project description

actbreak

CI License: Prosperity 3.0.0 Python

A local breakpoint debugger for act. act runs GitHub Actions workflows locally, but there's no way to pause mid-run and look around. actbreak injects a real breakpoint into a workflow, waits for the job container to reach it, and drops you into a live shell inside the still-running container. Resume when you're done, and the workflow keeps going.

Zero runtime dependencies. Python 3.9+, stdlib only.

Status

Early / v0.1.0. Core injection and selection logic is unit tested; the run/resume/clean orchestration against real act + Docker/Podman is covered by a CI integration test rather than exercised in every environment this ships to.

Install

git clone https://github.com/munzzyy/actbreak
cd actbreak
pip install -e .

Once it's on PyPI: pipx install actbreak.

Requires act on PATH, and one of Docker or Podman.

Usage

actbreak run <workflow.yml> --break-before <step>
actbreak run <workflow.yml> --break-after <step>
actbreak run <workflow.yml> --break-on-failure

actbreak resume
actbreak clean

<workflow.yml> is either a path to a workflow file, or a bare name looked up under .github/workflows/.

A step selector is either a step's name: value, or <job>:<index> to select by zero-based position (use this for steps with no name:).

run flags

Flag Meaning
--break-before STEP pause immediately before STEP runs
--break-after STEP pause immediately after STEP runs
--break-on-failure if act exits nonzero, attach to the last job container for post-mortem
--job JOB disambiguate a multi-job workflow
--runtime {docker,podman,auto} container runtime to use (default: auto-detect)
--no-attach don't exec a shell automatically; print the attach command and hold
--act-arg ARG extra argument passed through to act (repeatable)
-v, --verbose print the injection/act commands being run

Examples

actbreak run ci.yml --break-before "Run tests"
actbreak run ci.yml --job build --break-before build:2
actbreak run ci.yml --break-after "Build" --no-attach
actbreak run ci.yml --break-on-failure

How it works

  1. Finds the target workflow and, using the given job/step selector, resolves an exact step in it.
  2. Copies the workflow to a temp file and splices a synthetic step in immediately before or after the target, using line-based text injection (never a YAML parse-and-re-serialize round trip; see below for why).
  3. The injected step drops a sentinel file (/tmp/actbreak/hold) and blocks on it inside the container.
  4. Runs act -W <temp copy> --reuse so the container stays alive after the run "finishes" (i.e. hangs at the hold).
  5. Polls docker ps / podman ps for the job's container, then for the sentinel file, to know the breakpoint has been hit.
  6. Execs an interactive shell into the container. Exiting the shell (or running actbreak resume) deletes the sentinel and lets the job continue.

Why not just parse the YAML?

Because round-tripping a workflow through a generic YAML library corrupts it. PyYAML's default loader coerces an unquoted on: key to the boolean True under YAML 1.1 rules, and any generic dumper throws away comments, quoting style, and anchors. actbreak never deserializes the file. It scans for jobs:, then the target job, then its steps: list, using indentation alone, and splices in new lines at the right point. Every other byte in the file is untouched.

Development

pip install -e ".[dev]"
python -m unittest
pytest

The integration pytest marker (pytest -m integration) runs a real act + Docker/Podman end-to-end test; it's auto-skipped unless both are on PATH, which in practice means it only runs in CI.

License

Prosperity Public License 3.0.0 — free for noncommercial use, thirty-day trial for commercial use. See LICENSE. Contributions come in under the Blue Oak Model License; see CONTRIBUTING.md.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

actbreak-0.1.0.tar.gz (27.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

actbreak-0.1.0-py3-none-any.whl (20.8 kB view details)

Uploaded Python 3

File details

Details for the file actbreak-0.1.0.tar.gz.

File metadata

  • Download URL: actbreak-0.1.0.tar.gz
  • Upload date:
  • Size: 27.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.6

File hashes

Hashes for actbreak-0.1.0.tar.gz
Algorithm Hash digest
SHA256 0d784503f8c064517c16c2023da06d6eb70a1fc8465caa211533fb3045ffd76c
MD5 50516203048e07fdd5c5484e1adbad00
BLAKE2b-256 2842d3e45375183ecf5b9dc9c526b8a609583dac71838a038617cf711ce804d5

See more details on using hashes here.

File details

Details for the file actbreak-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: actbreak-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 20.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.6

File hashes

Hashes for actbreak-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 dcb9b7eeae5e08ae21176b1dc820b55279dff94ecd536eec8974a095fa0826d5
MD5 c442756ed4c74beb9c11df2c379b29c2
BLAKE2b-256 84627b417b6207ba662b095819e95c0ccef75ca0f062d394b208bbbc9b213aa5

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page