Documentation
¶
Index ¶
- type Config
- type CreateRefInput
- type DeleteRefInput
- type Github
- func (g *Github) ClosePullRequest(ctx context.Context, pullReq scm.PullRequest) error
- func (g *Github) CommitThroughAPI(ctx context.Context, repo repository, branch string, commitMessage string, ...) error
- func (g *Github) CreateBranch(ctx context.Context, repo repository, branchName string, oid string) error
- func (g *Github) CreatePullRequest(ctx context.Context, repo scm.Repository, prRepo scm.Repository, ...) (scm.PullRequest, error)
- func (g *Github) ForkRepository(ctx context.Context, repo scm.Repository, newOwner string) (scm.Repository, error)
- func (g *Github) GetAutocompleteOrganizations(ctx context.Context, _ string) ([]string, error)
- func (g *Github) GetAutocompleteRepositories(ctx context.Context, str string) ([]string, error)
- func (g *Github) GetAutocompleteUsers(ctx context.Context, str string) ([]string, error)
- func (g *Github) GetOpenPullRequest(ctx context.Context, repo scm.Repository, branchName string) (scm.PullRequest, error)
- func (g *Github) GetPullRequests(ctx context.Context, branchName string) ([]scm.PullRequest, error)
- func (g *Github) GetRepositories(ctx context.Context) ([]scm.Repository, error)
- func (g *Github) MergePullRequest(ctx context.Context, pullReq scm.PullRequest) error
- func (g *Github) Push(ctx context.Context, r scm.Repository, commitMessage string, ...) error
- func (g *Github) UpdatePullRequest(ctx context.Context, repo scm.Repository, pullReq scm.PullRequest, ...) (scm.PullRequest, error)
- type RepositoryInput
- type RepositoryListing
- type RepositoryReference
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶ added in v0.44.2
type Config struct {
Token string
BaseURL string
TransportMiddleware func(http.RoundTripper) http.RoundTripper
RepoListing RepositoryListing
MergeTypes []scm.MergeType
ForkMode bool
ForkOwner string
SSHAuth bool
ReadOnly bool
CheckPermissions bool
}
type CreateRefInput ¶ added in v0.57.0
type DeleteRefInput ¶ added in v0.57.0
type DeleteRefInput struct {
Input struct {
RefID string `json:"refId"`
} `json:"input"`
}
type Github ¶
type Github struct {
RepositoryListing
MergeTypes []scm.MergeType
// This determines if forks will be used when creating a prs.
// In this package, it mainly determines which repos are possible to make changes on
Fork bool
// This determines when we are running in read only mode.
ReadOnly bool
// If set, the fork will happen to the ForkOwner value, and not the logged in user
ForkOwner string
// If set, use the SSH clone url instead of http(s)
SSHAuth bool
// contains filtered or unexported fields
}
Github contain github configuration
func (*Github) ClosePullRequest ¶
ClosePullRequest closes a pull request
func (*Github) CommitThroughAPI ¶ added in v0.57.0
func (*Github) CreateBranch ¶ added in v0.57.0
func (*Github) CreatePullRequest ¶
func (g *Github) CreatePullRequest(ctx context.Context, repo scm.Repository, prRepo scm.Repository, newPR scm.NewPullRequest) (scm.PullRequest, error)
CreatePullRequest creates a pull request
func (*Github) ForkRepository ¶ added in v0.27.0
func (g *Github) ForkRepository(ctx context.Context, repo scm.Repository, newOwner string) (scm.Repository, error)
ForkRepository forks a repository. If newOwner is empty, fork on the logged in user
func (*Github) GetAutocompleteOrganizations ¶
GetAutocompleteOrganizations gets organizations for autocompletion
func (*Github) GetAutocompleteRepositories ¶
GetAutocompleteRepositories gets repositories for autocompletion
func (*Github) GetAutocompleteUsers ¶
GetAutocompleteUsers gets users for autocompletion
func (*Github) GetOpenPullRequest ¶ added in v0.37.0
func (g *Github) GetOpenPullRequest(ctx context.Context, repo scm.Repository, branchName string) (scm.PullRequest, error)
GetOpenPullRequest gets a pull request for one specific repository
func (*Github) GetPullRequests ¶
GetPullRequests gets all pull requests of with a specific branch
func (*Github) GetRepositories ¶
GetRepositories fetches repositories from all sources (orgs/user/specific repo)
func (*Github) MergePullRequest ¶
MergePullRequest merges a pull request
func (*Github) UpdatePullRequest ¶ added in v0.50.0
func (g *Github) UpdatePullRequest(ctx context.Context, repo scm.Repository, pullReq scm.PullRequest, updatedPR scm.NewPullRequest) (scm.PullRequest, error)
UpdatePullRequest updates an existing pull request
type RepositoryInput ¶ added in v0.57.0
type RepositoryListing ¶
type RepositoryListing struct {
Organizations []string
Users []string
Repositories []RepositoryReference
RepositorySearch string
CodeSearch string
Topics []string
SkipForks bool
}
RepositoryListing contains information about which repositories that should be fetched
type RepositoryReference ¶
RepositoryReference contains information to be able to reference a repository
func ParseRepositoryReference ¶
func ParseRepositoryReference(val string) (RepositoryReference, error)
ParseRepositoryReference parses a repository reference from the format "ownerName/repoName"
func (RepositoryReference) String ¶ added in v0.27.0
func (rr RepositoryReference) String() string
String returns the string representation of a repo reference