github

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 1, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package github lists and clones repositories from a GitHub org via the GitHub API and the git CLI.

Index

Constants

View Source
const (
	StatusCloned  = "cloned"
	StatusSkipped = "skipped"
	StatusFailed  = "failed"
)

Clone result statuses, the allowed values of CloneResult.Status.

Variables

This section is empty.

Functions

This section is empty.

Types

type CloneResult

type CloneResult struct {
	Repo   RemoteRepo `json:"repo"`
	Path   string     `json:"path"`
	Status string     `json:"status"`
	Reason string     `json:"reason,omitempty"`
	Error  string     `json:"error,omitempty"`
}

CloneResult is the outcome of cloning one remote repository.

func CloneOrg

func CloneOrg(ctx context.Context, org, root, match string, includeArchived bool, concurrency int) ([]CloneResult, error)

CloneOrg lists an org's repos and clones them into root.

func CloneRepos

func CloneRepos(ctx context.Context, repos []RemoteRepo, root string, concurrency int) []CloneResult

CloneRepos clones each repo into root concurrently, returning results in order.

type RemoteRepo

type RemoteRepo struct {
	Name     string `json:"name"`
	SSHURL   string `json:"ssh_url"`
	CloneURL string `json:"clone_url"`
	Archived bool   `json:"archived"`
}

RemoteRepo is a repository discovered on the remote (e.g. a GitHub org).

func ListOrgRepos

func ListOrgRepos(ctx context.Context, org, match string, includeArchived bool) ([]RemoteRepo, error)

ListOrgRepos lists an org's repositories, optionally filtered by the match regexp and excluding archived repos.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL