github

package
v3.8.5 Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2025 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BasePull

type BasePull struct {
	Number         int
	MergeCommitSha string
	Labels         []string
}

type Client

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

func NewClient

func NewClient(baseUrl, token, userAgent string) (*Client, error)

func (*Client) CompareCommits

func (g *Client) CompareCommits(
	ctx context.Context,
	owner, repo, base, head string,
	count int,
) (*CommitComparison, error)

CompareCommits returns a commit comparison that includes up to count commits. If count is -1, all commits are included. If count is 0, no commits are included.

func (*Client) CreateRelease

func (g *Client) CreateRelease(
	ctx context.Context,
	owner, repo, tag, body string,
	prerelease bool,
) (*RepoRelease, error)

func (*Client) DeleteRelease

func (g *Client) DeleteRelease(ctx context.Context, owner, repo string, id int64) error

func (*Client) GenerateReleaseNotes

func (g *Client) GenerateReleaseNotes(ctx context.Context, owner, repo, tag, prevTag string) (string, error)

func (*Client) GetPullRequest

func (g *Client) GetPullRequest(ctx context.Context, owner, repo string, number int) (*BasePull, error)

func (*Client) GetPullRequestCommits

func (g *Client) GetPullRequestCommits(ctx context.Context, owner, repo string, number int) ([]string, error)

func (*Client) ListMergedPullsForCommit

func (g *Client) ListMergedPullsForCommit(ctx context.Context, owner, repo, sha string) ([]BasePull, error)

func (*Client) PublishRelease

func (g *Client) PublishRelease(ctx context.Context, owner, repo, makeLatest string, id int64) error

func (*Client) UploadAsset

func (g *Client) UploadAsset(ctx context.Context, uploadURL, filename string) error

UploadAsset is largely copied from github.Client.UploadReleaseAsset. It is modified to use uploadURL instead of building it from releaseID so that we don't need to set upload url. It also accepts a filename instead of an *os.File.

type CommitComparison

type CommitComparison struct {
	AheadBy  int
	BehindBy int
	Commits  []string
}

type RepoRelease

type RepoRelease struct {
	ID        int64
	UploadURL string
}

Jump to

Keyboard shortcuts

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