diff --git a/src/devx/molecule/molecule_ci_guard.py b/src/devx/molecule/molecule_ci_guard.py index eb8ffa8..e7f9a93 100644 --- a/src/devx/molecule/molecule_ci_guard.py +++ b/src/devx/molecule/molecule_ci_guard.py @@ -219,7 +219,10 @@ def cli(pairs: tuple[str, ...], junit_output: str | None, roles_root: Path | Non if not all([gitea_url, token, run_id]): click.echo(_("GITEA_URL/REPO_TOKEN/RUN_ID not set; running without cross-runner cancellation.")) - repo_root = Path(__file__).resolve().parent.parent.parent.parent + # When devx is installed as a pip package, __file__ resolves to the + # site-packages directory, not the repo root. Use GITHUB_WORKSPACE + # (set by Gitea Actions) or cwd as the repo root. + repo_root = Path(os.environ.get("GITHUB_WORKSPACE", os.getcwd())).resolve() base_env = os.environ.copy() base_env.setdefault("DOCKER_HOST", f"unix:///run/user/{os.getuid()}/docker.sock")