Documentation
¶
Index ¶
- Variables
- func FetchLatestReleaseTag(ctx context.Context, client *http.Client, owner string, repo string) (string, error)
- type CreatePROptions
- type CreateReleaseOptions
- type Github
- func New(git git.Git, cfg *viper.Viper) (Github, error)
- func NewAuthOnly(cfg *viper.Viper) (Github, error)
- func NewAuthOnlyWithOptions(cfg *viper.Viper, allowPrompt bool) (Github, error)
- func NewWithHTTPClient(g git.Git, cfg *viper.Viper, httpClient *http.Client, baseURL string) (Github, error)
- func NewWithHTTPClientAndRepo(g git.Git, cfg *viper.Viper, httpClient *http.Client, ...) (Github, error)
- func NewWithOptions(git git.Git, cfg *viper.Viper, allowPrompt bool) (Github, error)
- type GithubConfig
- type Label
- type PullRequest
- type Release
- type Team
- type User
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrAuthRequired = errors.New("github authentication required; run `fotingo login` interactively")
View Source
var ErrOAuthClientIDMissing = errors.New("github oauth client id is missing in this build; use `fotingo login` with API token auth or rebuild with oauth ldflags")
Functions ¶
Types ¶
type CreatePROptions ¶
CreatePROptions contains the options for creating a pull request
type CreateReleaseOptions ¶
type CreateReleaseOptions struct {
TagName string
TargetCommitish string
Name string
Body string
Draft bool
Prerelease bool
}
CreateReleaseOptions contains the options for creating a release
type Github ¶
type Github interface {
auth.OauthService
config.ConfigurableService
// GetPullRequestUrl returns the URL of the pull request for current branch or an error if it can't be found
GetPullRequestUrl() (string, error)
// GetCurrentUser returns the information about the current authenticated user
GetCurrentUser() (*hub.User, error)
// CreatePullRequest creates a new pull request
CreatePullRequest(opts CreatePROptions) (*PullRequest, error)
// GetLabels returns all labels from the repository
GetLabels() ([]Label, error)
// AddLabelsToPR adds labels to a pull request
AddLabelsToPR(prNumber int, labels []string) error
// GetCollaborators returns repository collaborators for reviewer selection
GetCollaborators() ([]User, error)
// GetOrgMembers returns organization members for participant selection
GetOrgMembers() ([]User, error)
// GetTeams returns organization teams for team reviewer selection
GetTeams() ([]Team, error)
// RequestReviewers requests reviewers on a pull request
RequestReviewers(prNumber int, reviewers []string, teamReviewers []string) error
// AssignUsersToPR assigns users to a pull request
AssignUsersToPR(prNumber int, assignees []string) error
// DoesPRExistForBranch checks if a PR exists for a given branch
DoesPRExistForBranch(branch string) (bool, *PullRequest, error)
// CreateRelease creates a GitHub release
CreateRelease(opts CreateReleaseOptions) (*Release, error)
}
func NewAuthOnlyWithOptions ¶
func NewWithHTTPClient ¶
func NewWithHTTPClient(g git.Git, cfg *viper.Viper, httpClient *http.Client, baseURL string) (Github, error)
NewWithHTTPClient returns a new GitHub client using the provided HTTP client and base URL. This bypasses OAuth authentication and is intended for testing with mock servers.
type GithubConfig ¶
type GithubConfig struct {
Token string
}
type PullRequest ¶
PullRequest represents a GitHub pull request
Click to show internal directories.
Click to hide internal directories.