Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,16 @@ def run_gh_command_raw(args: Sequence[str], cwd: Path) -> tuple[int, bytes, str]
return process.returncode, process.stdout, stderr


def has_repo_access(repo_root: Path) -> bool:
"""Verify the authenticated (triggering) user has at least read access to the repo."""
result = run_gh_command(
["repo", "view", "--json", "viewerPermission", "--jq", ".viewerPermission"],
repo_root,
)
permission = result.stdout.strip()
return result.returncode == 0 and permission not in ("", "NONE")


def parse_args() -> argparse.Namespace:
parser = argparse.ArgumentParser(
description=(
Expand Down
Loading