Documentation
¶
Overview ¶
Package discover finds the repositories to operate on by reconciling the local ~/projects/{org}/{repo} tree with the non-archived repositories GitHub reports for the relevant orgs.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsArchived ¶ added in v0.60.0
IsArchived confirms, live against GitHub, whether the repository named by slug ("owner/repository") is archived right now. It is deliberately a single per-repository query rather than a reuse of a fleet-wide listing (ListRemote, or a caller's own cached Repo.Archived): a bulk listing can be stale by the time a destructive decision is made from it, can silently omit a repository the caller lacks org-listing access to, and answers "was this archived when the list was built" rather than "is this archived now". A caller about to delete a local clone based on archived status must ask this exact question about this exact repository immediately before acting, and must treat any error (network, auth, rate limit, unknown repository) as "could not confirm" rather than guessing either way.
func MemberOrgs ¶
MemberOrgs returns the GitHub orgs the authenticated user belongs to. This is the authoritative source of "owners I control" — local directory names are not, since they include third-party clones.
Types ¶
type Repo ¶
type Repo struct {
Org string
Name string
Path string // local working-tree path; empty if not cloned locally
CloneURL string // ssh URL from GitHub; empty if only known locally
Archived bool
IsFork bool
Local bool
Remote bool
}
Repo identifies a single repository and where it lives.
func ListRemote ¶
ListRemote returns all repos for owner via gh. The archived flag is preserved so callers can report and skip archived repos explicitly.
func Reconcile ¶
Reconcile merges locally-cloned repos with remotely-listed ones, keyed by org/name. Remote metadata (archived flag, clone URL) wins where both exist. The result is sorted by slug for deterministic output.