github

package
v1.10.0 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2026 License: Apache-2.0 Imports: 15 Imported by: 3 modules, 3 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Asset added in v0.2.0

type Asset struct {
	Path   string
	URL    string
	APIURL string
}

type Client

type Client struct {
	*github.Client
	// contains filtered or unexported fields
}

Client is the client for interacting with the GitHub API

func NewClient added in v0.2.0

func NewClient(owner, repo, token, baseURL, uploadURL string) *Client

NewClient creates and initializes a new GitHubClient

func (*Client) CreatePullRequest added in v1.1.0

func (c *Client) CreatePullRequest(owner string, repo string, message string, head string, base string) (string, error)

CreatePullRequest creates a pull request in the repository specified by repoURL. The return value is the pull request URL.

func (*Client) CreateRelease

func (c *Client) CreateRelease(_ context.Context, input *Release) error

CreateRelease creates a new release object in the GitHub API. To support repositories with immutable releases enabled (see https://github.blog/changelog/2025-10-28-immutable-releases-are-now-generally-available/), the release is first created as a draft, assets are uploaded, and then the release is published. This ensures that assets can be uploaded before the release becomes immutable.

func (*Client) CreateSignedCommit added in v1.10.0

func (c *Client) CreateSignedCommit(ctx context.Context, branch, expectedHead, path, message string, contents []byte) error

CreateSignedCommit updates one file on a branch using GitHub's server-side signing. expectedHead must be the revision used to prepare contents.

func (*Client) GenerateReleaseNotes added in v1.9.0

func (c *Client) GenerateReleaseNotes(_ context.Context, tag string, previousTag string, commit string) (string, error)

GenerateReleaseNotes generates release notes for the given tag, comparing against previousTag. Since the tag may not exist yet at generation time, commit (falling back to the default branch when empty) determines the target of the comparison.

func (*Client) GetRelease

func (c *Client) GetRelease(_ context.Context, tag string) (*Release, error)

GetRelease queries the GitHub API for a specified release object

func (*Client) ListTagsWithPrefix added in v1.9.0

func (c *Client) ListTagsWithPrefix(_ context.Context, prefix string) ([]string, error)

ListTagsWithPrefix returns the names of all tags starting with the given prefix

func (*Client) ReplaceReleaseAssets added in v1.10.0

func (c *Client) ReplaceReleaseAssets(ctx context.Context, input *Release) (bool, error)

ReplaceReleaseAssets replaces a chart archive and its optional provenance in an existing mutable release. It returns false when the release does not exist. Callers must serialize publishing: GitHub provides no transaction across assets, and the subsequent Pages/index update is a separate operation.

type Release added in v0.2.0

type Release struct {
	Name                 string
	Description          string
	Assets               []*Asset
	Commit               string
	GenerateReleaseNotes bool
	MakeLatest           string
	PreRelease           bool
}

Jump to

Keyboard shortcuts

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