Documentation
¶
Index ¶
- Constants
- Variables
- func CreateWebHook(ctx context.Context, ...) error
- func GitProviderName(url string) (string, error)
- func RepoOwnerAndNameFromUrl(url string) (string, string, error)
- func ResolveBranch(repoPath string) string
- func ResolveRemoteURL(repoPath string) (string, error)
- type SupportedProviders
Constants ¶
View Source
const ( GitHubProvider = "github" GitLabProvider = "gitlab" BitBucketProvider = "bitbucket-cloud" )
Variables ¶
View Source
var SupportedProvidersList = SupportedProviders{GitHubProvider, GitLabProvider}
Functions ¶
func CreateWebHook ¶ added in v0.38.0
func GitProviderName ¶
func RepoOwnerAndNameFromUrl ¶
RepoOwnerAndNameFromUrl for input url returns repo owner and repo name eg. for github.com/foo/bar returns 'foo' and 'bar'
func ResolveBranch ¶ added in v0.50.0
ResolveBranch returns the current branch name for the repository at the given path. Returns "main" if the branch cannot be determined (not a git repo, detached HEAD, etc.).
func ResolveRemoteURL ¶ added in v0.50.0
ResolveRemoteURL detects the git remote URL for the repository at the given path. It prefers the current branch's tracking remote, falling back to "origin". Returns an empty string if no remote can be determined (not a git repo, no remotes configured, etc.). The URL is returned as-is (SSH or HTTPS).
Types ¶
type SupportedProviders ¶
type SupportedProviders []string
func (SupportedProviders) PrettyString ¶
func (sp SupportedProviders) PrettyString() string
Click to show internal directories.
Click to hide internal directories.