DEVX-37: fix: resolve repo_root from GITHUB_WORKSPACE or cwd

This commit is contained in:
emil
2026-06-24 18:49:43 +00:00
parent 8de91be405
commit c272150275
+4 -1
View File
@@ -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")