github

package
v0.11.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 28, 2025 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetClient

func GetClient(scmProvider v1alpha1.GenericScmProvider, secret v1.Secret) (*github.Client, error)

GetClient creates a new GitHub client using the provided SCM provider and secret.

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

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.

func (GitAuthenticationProvider) GetToken

GetToken retrieves the authentication token for GitHub.

func (GitAuthenticationProvider) GetUser

GetUser returns a static user identifier for GitHub authentication.

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

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL