github

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2026 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInstallNotFound = errors.New("github: app is not installed for repository owner")

Functions

func LoadPipelinesAtSHA

func LoadPipelinesAtSHA(ctx context.Context, c *Client, owner, name, sha string) ([]*engine.Pipeline, error)

Types

type Client

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

func (*Client) CreateCommitStatus

func (c *Client) CreateCommitStatus(ctx context.Context, cfg CreateCommitStatusConfig) error

func (*Client) DeleteReleaseAsset

func (c *Client) DeleteReleaseAsset(ctx context.Context, owner, name string, assetID int64) error

func (*Client) FetchRepository

func (c *Client) FetchRepository(ctx context.Context, owner string, name string) (*Repository, error)

func (*Client) GetContentAtSHA

func (c *Client) GetContentAtSHA(ctx context.Context, owner, name, path, ref string) (string, error)

func (*Client) GetInstallation

func (c *Client) GetInstallation(ctx context.Context, id int64) (*Installation, error)

func (*Client) GetTreeAtSHA

func (c *Client) GetTreeAtSHA(ctx context.Context, owner, name, sha string) ([]TreeEntry, error)

func (*Client) ListBranches

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

func (*Client) ListInstallationRepos

func (c *Client) ListInstallationRepos(ctx context.Context) ([]Repository, error)

func (*Client) ListReleaseAssets

func (c *Client) ListReleaseAssets(ctx context.Context, owner, name string, releaseID int64) ([]*gh.ReleaseAsset, error)

func (*Client) ListUserInstallations

func (c *Client) ListUserInstallations(ctx context.Context) ([]Installation, error)

func (*Client) ResolveTagSHA

func (c *Client) ResolveTagSHA(ctx context.Context, owner, name, tag string) (string, error)

func (*Client) UploadReleaseAsset

func (c *Client) UploadReleaseAsset(ctx context.Context, owner, name string, releaseID int64, assetName string, file *os.File) (*gh.ReleaseAsset, error)

type Config

type Config struct {
	AppID      string
	PrivateKey string
	PublicURL  string
	AppSlug    string
}

type CreateCommitStatusConfig

type CreateCommitStatusConfig struct {
	Owner     string
	Name      string
	SHA       string
	State     string
	Context   string
	Desc      string
	TargetURL string
}

type InstallStatusResult

type InstallStatusResult struct {
	Installed  bool
	Accounts   []Installation
	InstallURL string
}

type Installation

type Installation struct {
	ID           int64
	AccountLogin string
	AccountType  string
}

type Integration

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

Integration is the Github bot

func New

func New(cfg Config, st *store.Store, mgr *daemon.Manager) (*Integration, error)

func (*Integration) InstallStatus

func (i *Integration) InstallStatus(ctx context.Context, userToken string) (InstallStatusResult, error)

func (*Integration) LinkUserIntegration

func (i *Integration) LinkUserIntegration(ctx context.Context, userID string, userToken string) ([]Installation, error)

func (*Integration) ListBranches

func (i *Integration) ListBranches(ctx context.Context, userToken, fullName string) ([]string, error)

func (*Integration) ListInstallableRepos

func (i *Integration) ListInstallableRepos(ctx context.Context, userToken string) ([]Repository, error)

func (*Integration) ListUserIntegrations

func (i *Integration) ListUserIntegrations(ctx context.Context, userID string) ([]store.UserIntegration, error)

func (*Integration) Name

func (i *Integration) Name() string

func (*Integration) RecordInstall

func (i *Integration) RecordInstall(ctx context.Context, installID int64, setupAction string) error

func (*Integration) SubmitPush

func (i *Integration) SubmitPush(ctx context.Context, tracked store.TrackedRepository, ref, sha string, installID int64) ([]*daemon.Run, error)

func (*Integration) SubmitRelease

func (i *Integration) SubmitRelease(ctx context.Context, tracked store.TrackedRepository, installID int64, info ReleaseInfo) ([]*daemon.Run, error)

func (*Integration) TrackRepository

func (i *Integration) TrackRepository(ctx context.Context, userToken, ownerID, fullName, branch string) error

func (*Integration) UnlinkUserIntegration

func (i *Integration) UnlinkUserIntegration(ctx context.Context, userID, provider string) error

type ReleaseInfo

type ReleaseInfo struct {
	Action    string
	Tag       string
	ReleaseID int64
}

type Repository

type Repository struct {
	ID            string
	FullName      string
	DefaultBranch string
}

type TreeEntry

type TreeEntry struct {
	Path string
	Type string
}

Jump to

Keyboard shortcuts

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