MCPcopy Index your code
hub / github.com/usestrix/strix / _extract_github_base_sha

Function _extract_github_base_sha

strix/interface/utils.py:609–626  ·  view source on GitHub ↗
(env: dict[str, str])

Source from the content-addressed store, hash-verified

607
608
609def _extract_github_base_sha(env: dict[str, str]) -> str | None:
610 event_path = env.get("GITHUB_EVENT_PATH", "").strip()
611 if not event_path:
612 return None
613
614 path = Path(event_path)
615 if not path.exists():
616 return None
617
618 try:
619 payload = json.loads(path.read_text(encoding="utf-8"))
620 except (json.JSONDecodeError, OSError):
621 return None
622
623 base_sha = payload.get("pull_request", {}).get("base", {}).get("sha")
624 if isinstance(base_sha, str) and base_sha.strip():
625 return base_sha.strip()
626 return None
627
628
629def _resolve_default_branch_name(repo_path: Path, env: dict[str, str]) -> str | None:

Callers 1

_resolve_base_refFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected