Documentation
¶
Index ¶
- func GetClient(scmProvider v1alpha1.GenericScmProvider, secret v1.Secret) (*github.Client, error)
- type CommitStatus
- type GitAuthenticationProvider
- type PullRequest
- func (pr *PullRequest) Close(ctx context.Context, pullRequest v1alpha1.PullRequest) error
- func (pr *PullRequest) Create(ctx context.Context, title, head, base, description string, ...) (string, error)
- func (pr *PullRequest) FindOpen(ctx context.Context, pullRequest v1alpha1.PullRequest) (bool, v1alpha1.PullRequestCommonStatus, error)
- func (pr *PullRequest) GetUrl(ctx context.Context, pullRequest v1alpha1.PullRequest) (string, error)
- func (pr *PullRequest) Merge(ctx context.Context, pullRequest v1alpha1.PullRequest) error
- func (pr *PullRequest) Update(ctx context.Context, title, description string, ...) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CommitStatus ¶
type CommitStatus struct {
// contains filtered or unexported fields
}
CommitStatus implements the scms.CommitStatusProvider interface for GitHub.
func NewGithubCommitStatusProvider ¶
func NewGithubCommitStatusProvider(k8sClient client.Client, scmProvider promoterv1alpha1.GenericScmProvider, secret v1.Secret) (*CommitStatus, error)
NewGithubCommitStatusProvider creates a new instance of CommitStatus for GitHub.
func (CommitStatus) Set ¶
func (cs CommitStatus) Set(ctx context.Context, commitStatus *promoterv1alpha1.CommitStatus) (*promoterv1alpha1.CommitStatus, error)
Set sets the commit status for a given commit SHA in the specified repository.
type GitAuthenticationProvider ¶
type GitAuthenticationProvider struct {
// contains filtered or unexported fields
}
GitAuthenticationProvider provides methods to authenticate with GitHub using a GitHub App.
func NewGithubGitAuthenticationProvider ¶
func NewGithubGitAuthenticationProvider(scmProvider v1alpha1.GenericScmProvider, secret *v1.Secret) GitAuthenticationProvider
NewGithubGitAuthenticationProvider creates a new instance of GitAuthenticationProvider for GitHub using the provided SCM provider and secret.
func (GitAuthenticationProvider) GetGitHttpsRepoUrl ¶
func (gh GitAuthenticationProvider) GetGitHttpsRepoUrl(gitRepository v1alpha1.GitRepository) string
GetGitHttpsRepoUrl constructs the HTTPS URL for a GitHub repository based on the provided GitRepository object.
type PullRequest ¶
type PullRequest struct {
// contains filtered or unexported fields
}
PullRequest implements the scms.PullRequestProvider interface for GitHub.
func NewGithubPullRequestProvider ¶
func NewGithubPullRequestProvider(k8sClient client.Client, scmProvider v1alpha1.GenericScmProvider, secret v1.Secret) (*PullRequest, error)
NewGithubPullRequestProvider creates a new instance of PullRequest for GitHub.
func (*PullRequest) Close ¶
func (pr *PullRequest) Close(ctx context.Context, pullRequest v1alpha1.PullRequest) error
Close closes an existing pull request.
func (*PullRequest) Create ¶
func (pr *PullRequest) Create(ctx context.Context, title, head, base, description string, pullRequest v1alpha1.PullRequest) (string, error)
Create creates a new pull request with the specified title, head, base, and description.
func (*PullRequest) FindOpen ¶
func (pr *PullRequest) FindOpen(ctx context.Context, pullRequest v1alpha1.PullRequest) (bool, v1alpha1.PullRequestCommonStatus, error)
FindOpen checks if a pull request is open and returns its status.
func (*PullRequest) GetUrl ¶ added in v0.10.0
func (pr *PullRequest) GetUrl(ctx context.Context, pullRequest v1alpha1.PullRequest) (string, error)
GetUrl returns the URL of the pull request.
func (*PullRequest) Merge ¶
func (pr *PullRequest) Merge(ctx context.Context, pullRequest v1alpha1.PullRequest) error
Merge merges an existing pull request with the specified commit message.
func (*PullRequest) Update ¶
func (pr *PullRequest) Update(ctx context.Context, title, description string, pullRequest v1alpha1.PullRequest) error
Update updates an existing pull request with the specified title and description.