githubclient

package
v6.23.2 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2024 License: Apache-2.0 Imports: 11 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.

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) 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) 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 added in v6.22.0

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

type Config

type Config struct {
	DryRun bool
	Logger *logrus.Logger

	AccessToken string
}

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