githubclient

package
v7.6.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsExecution

func IsExecution(err error) bool

IsExecution asserts executionError.

func IsInstallationNotFound

func IsInstallationNotFound(err error) bool

IsInstallationNotFound asserts installationNotFoundError.

func IsInvalidConfig

func IsInvalidConfig(err error) bool

IsInvalidConfig asserts invalidConfigError.

func IsNotFound

func IsNotFound(err error) bool

IsNotFound asserts notFoundError.

func IsPRMergeTimeout added in v7.2.0

func IsPRMergeTimeout(err error) bool

IsPRMergeTimeout asserts prMergeTimeoutError.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

func New

func New(config Config) (*Client, error)

func (*Client) AddRepoToRenovatePermissions

func (c *Client) AddRepoToRenovatePermissions(ctx context.Context, org string, repo *github.Repository) error

Add repository to the Renovate installation. Corresponds to https://docs.github.com/en/rest/apps/installations?apiVersion=2022-11-28#add-a-repository-to-an-app-installation

func (*Client) CloneRepository added in v7.2.0

func (c *Client) CloneRepository(ctx context.Context, owner, repo, workDir string) error

func (*Client) CommitAndPush added in v7.2.0

func (c *Client) CommitAndPush(ctx context.Context, owner, repo, branch, message string) error

func (*Client) CreateBranch added in v7.2.0

func (c *Client) CreateBranch(ctx context.Context, newBranch string) error

func (*Client) CreateFromTemplate added in v7.2.0

func (c *Client) CreateFromTemplate(ctx context.Context, templateOwner, templateRepo, newOwner string, repository *github.Repository) (*github.Repository, error)

func (*Client) CreatePullRequest added in v7.2.0

func (c *Client) CreatePullRequest(ctx context.Context, owner, repo, head, title string) (*github.PullRequest, error)

func (*Client) GetFile

func (c *Client) GetFile(ctx context.Context, owner, repo, path, ref string) (RepositoryFile, error)

func (*Client) GetRepository

func (c *Client) GetRepository(ctx context.Context, owner, repo string) (*github.Repository, error)

func (*Client) GetUnderlyingClient added in v7.2.3

func (c *Client) GetUnderlyingClient(ctx context.Context) *github.Client

GetUnderlyingClient returns the underlying go-github client. This allows access to the full GitHub API if needed.

func (*Client) ListRepositories

func (c *Client) ListRepositories(ctx context.Context, owner string) ([]Repository, error)

func (*Client) RemoveRepoFromRenovatePermissions

func (c *Client) RemoveRepoFromRenovatePermissions(ctx context.Context, org string, repo *github.Repository) error

Remove repository from the Renovate installation. Corresponds to https://docs.github.com/en/rest/apps/installations?apiVersion=2022-11-28#remove-a-repository-from-an-app-installation

func (*Client) RemoveRepositoryBranchProtection

func (c *Client) RemoveRepositoryBranchProtection(ctx context.Context, repository *github.Repository) (err error)

func (*Client) SetRepositoryBranchProtection

func (c *Client) SetRepositoryBranchProtection(ctx context.Context, repository *github.Repository, checkNames []string, checksFilter *regexp.Regexp) (err error)

func (*Client) SetRepositoryDefaultBranch

func (c *Client) SetRepositoryDefaultBranch(ctx context.Context, repository *github.Repository, newDefaultBranch string) (err error)

func (*Client) SetRepositoryPermissions

func (c *Client) SetRepositoryPermissions(ctx context.Context, repository *github.Repository, permissions map[string]string) error

func (*Client) SetRepositorySettings

func (c *Client) SetRepositorySettings(ctx context.Context, repository, repositorySettings *github.Repository) (*github.Repository, error)

func (*Client) SetRepositoryWebhooks

func (c *Client) SetRepositoryWebhooks(ctx context.Context, repository *github.Repository, hook *github.Hook) error

func (*Client) WaitForPRMerge added in v7.2.0

func (c *Client) WaitForPRMerge(ctx context.Context, owner, repo string, prNumber int, timeout time.Duration) error

type Config

type Config struct {
	Logger      *logrus.Logger
	AccessToken string
	DryRun      bool
}

type Repository

type Repository struct {
	Name      string
	Language  string
	Owner     string
	UpdatedAt time.Time
}

type RepositoryFile

type RepositoryFile struct {
	Data []byte
	Path string
}

Jump to

Keyboard shortcuts

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