github

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2024 License: GPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PerPageMax    = 100
	PRStateOpen   = "open"
	PRStateClosed = "closed"
	EnvAPIToken   = "GITHUB_TOKEN" // nolint:gosec // Not actually a hardcoded credential
	EnvUsername   = "GITHUB_USER"
	EnvRepository = "GITHUB_REPOSITORY"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type GitHub

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

func New

func New(log *slog.Logger, options *Options) *GitHub

func (*GitHub) CloneURL

func (g *GitHub) CloneURL() string

func (*GitHub) ClosePullRequest

func (g *GitHub) ClosePullRequest(ctx context.Context, pr *releasepr.ReleasePullRequest) error

func (*GitHub) CommitsSince

func (g *GitHub) CommitsSince(ctx context.Context, tag *git.Tag) ([]git.Commit, error)

func (*GitHub) CreatePullRequest

func (g *GitHub) CreatePullRequest(ctx context.Context, pr *releasepr.ReleasePullRequest) error

func (*GitHub) CreateRelease

func (g *GitHub) CreateRelease(ctx context.Context, commit git.Commit, title, changelog string, preRelease, latest bool) error

func (*GitHub) EnsureLabelsExist

func (g *GitHub) EnsureLabelsExist(ctx context.Context, labels []releasepr.Label) error

func (*GitHub) GitAuth

func (g *GitHub) GitAuth() transport.AuthMethod

func (*GitHub) LatestTags

func (g *GitHub) LatestTags(ctx context.Context) (git.Releases, error)

func (*GitHub) PendingReleases

func (g *GitHub) PendingReleases(ctx context.Context, pendingLabel releasepr.Label) ([]*releasepr.ReleasePullRequest, error)

func (*GitHub) PullRequestForBranch

func (g *GitHub) PullRequestForBranch(ctx context.Context, branch string) (*releasepr.ReleasePullRequest, error)

func (*GitHub) PullRequestURL

func (g *GitHub) PullRequestURL(id int) string

func (*GitHub) ReleaseURL

func (g *GitHub) ReleaseURL(version string) string

func (*GitHub) RepoURL

func (g *GitHub) RepoURL() string

func (*GitHub) SetPullRequestLabels

func (g *GitHub) SetPullRequestLabels(ctx context.Context, pr *releasepr.ReleasePullRequest, remove, add []releasepr.Label) error

func (*GitHub) UpdatePullRequest

func (g *GitHub) UpdatePullRequest(ctx context.Context, pr *releasepr.ReleasePullRequest) error

type Options

type Options struct {
	forge.Options

	Owner string
	Repo  string

	APIToken string
	Username string
}

Jump to

Keyboard shortcuts

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