Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Clone ¶
func Clone(ctx context.Context, repoURL, token, ref string) (dir string, commitSHA string, cleanup func(), err error)
Clone clones a git repository over HTTPS into a temporary directory. Returns the directory path, resolved HEAD commit SHA, a cleanup function, and any error.
The repoURL may embed a branch via the path (e.g. github.com/org/repo.git/mybranch). If ref is non-empty it overrides any branch embedded in the URL. If token is empty, Clone tries anonymous clone before retrying with GITHUB_AUTH_TOKEN.
func IsGitRepoURL ¶
IsGitRepoURL returns true if the URL points to a git repository on a known hosting platform (GitHub, GitLab) or ends with ".git".
func ResolveToken ¶
ResolveToken returns token if non-empty, otherwise falls back to GITHUB_AUTH_TOKEN env var.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.