Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Clone ¶
func Clone(ctx context.Context, repoURL, token, ref string, maxRepoSizeMB int) (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. A zero maxRepoSizeMB uses the default 100 MB repository size limit.
func IsGitRepoURL ¶
IsGitRepoURL returns true if the URL points to a git repository on a known hosting platform (GitHub, GitLab, Bitbucket) or ends with ".git".
func NormalizeRepositoryURL ¶ added in v0.26.1
NormalizeRepositoryURL validates an HTTPS Git repository URL, trims surrounding whitespace, and adds the HTTPS scheme when omitted. It preserves the repository path and any embedded branch so stored URLs and credential keys remain stable.
Types ¶
This section is empty.