Documentation
¶
Overview ¶
Package github implements the scm.Provider contract for GitHub repositories and pull-request workflows.
The package wraps go-github client interactions and maps GitHub-native data structures to shared scm models used by command handlers.
Index ¶
- func New(ctx context.Context, project string) scm.Provider
- type Github
- func (g *Github) CheckCapabilities(opts *scm.PROptions) error
- func (g *Github) GetPullRequest(repo, branch string) (*scm.PullRequest, error)
- func (g *Github) ListRepositories() ([]*scm.Repository, error)
- func (g *Github) MergePullRequest(repo, branch string, opts *scm.PRMergeOptions) (*scm.PullRequest, error)
- func (g *Github) OpenPullRequest(repo, branch string, opts *scm.PROptions) (*scm.PullRequest, error)
- func (g *Github) UpdatePullRequest(repo, branch string, opts *scm.PROptions) (*scm.PullRequest, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Github ¶
type Github struct {
// contains filtered or unexported fields
}
Github implements the scm.Provider interface for GitHub.
func (*Github) CheckCapabilities ¶ added in v0.11.0
CheckCapabilities validates that the provided PR options are supported by GitHub. The check is local to the static capability set and issues no request, so it requires no credential.
func (*Github) GetPullRequest ¶
func (g *Github) GetPullRequest(repo, branch string) (*scm.PullRequest, error)
GetPullRequest retrieves a pull request by repository name and source branch.
func (*Github) ListRepositories ¶
func (g *Github) ListRepositories() ([]*scm.Repository, error)
ListRepositories lists all repositories in the specified project. Supports both organization and user repositories.
func (*Github) MergePullRequest ¶
func (g *Github) MergePullRequest(repo, branch string, opts *scm.PRMergeOptions) (*scm.PullRequest, error)
MergePullRequest merges an existing pull request
func (*Github) OpenPullRequest ¶
func (g *Github) OpenPullRequest(repo, branch string, opts *scm.PROptions) (*scm.PullRequest, error)
OpenPullRequest opens a new pull request in the specified repository.
func (*Github) UpdatePullRequest ¶
func (g *Github) UpdatePullRequest(repo, branch string, opts *scm.PROptions) (*scm.PullRequest, error)
UpdatePullRequest updates an existing pull request.