Documentation
¶
Overview ¶
Package githubapp drives the CircleCI GitHub App onboarding steps: checking whether the app is installed for an organization, walking the user through a browser-based install, and resolving a repository's external ID.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrTooManyRepositories = errors.New("too many repositories to search for a match")
ErrTooManyRepositories reports that the search hit its page cap before examining every repository, so the target may well be accessible. Callers must not report it as "the app cannot access that repository" — the advice that follows from that, grant access and re-run, searches the same bounded prefix again.
Functions ¶
func EnsureInstalled ¶
func EnsureInstalled(ctx context.Context, client *apiclient.Client, orgID, returnURL string, noBrowser bool) (bool, error)
EnsureInstalled reports whether the CircleCI GitHub App is installed for the organization, walking the user through a browser-based install when it is not. returnURL is where GitHub redirects after install.
Non-interactive sessions (or noBrowser) print the install URL and return false without waiting. Callers degrade to manual guidance on false or on an error.
func ResolveRepoID ¶
func ResolveRepoID(ctx context.Context, client *apiclient.Client, orgID, repoFullName string) (string, error)
ResolveRepoID returns the provider's ID for repoFullName ("owner/repo") among the repositories the organization's connection can reach. The endpoint offers no name filter, so the list has to be walked.
It returns "" with no error only when the whole list was examined and held no match; hitting the page cap first returns ErrTooManyRepositories.
Types ¶
This section is empty.