github

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	HTTPClient *http.Client
	Token      string
	BaseURL    string // default: https://api.github.com
}

Client communicates with the GitHub REST API.

func NewClient

func NewClient(token string) *Client

NewClient creates a Client, optionally using $GITHUB_TOKEN for authentication.

func (*Client) LatestRelease

func (c *Client) LatestRelease(ctx context.Context, owner, repo string) (string, error)

LatestRelease returns the latest non-prerelease, non-draft release tag.

func (*Client) LatestTag

func (c *Client) LatestTag(ctx context.Context, owner, repo string) (string, error)

LatestTag returns the most recent tag by version sorting.

func (*Client) ListTags

func (c *Client) ListTags(ctx context.Context, owner, repo string) ([]Tag, error)

ListTags returns all tags for a repo (paginated, up to 100).

func (*Client) ResolveTagSHA

func (c *Client) ResolveTagSHA(ctx context.Context, owner, repo, ref string) (string, error)

ResolveTagSHA looks up the full commit SHA for a tag or branch ref.

type Release

type Release struct {
	TagName     string `json:"tag_name"`
	Prerelease  bool   `json:"prerelease"`
	Draft       bool   `json:"draft"`
	PublishedAt string `json:"published_at"`
}

Release represents a GitHub release.

type Tag

type Tag struct {
	Name   string `json:"name"`
	Commit struct {
		SHA string `json:"sha"`
	} `json:"commit"`
}

Tag represents a Git tag from the GitHub API.

Jump to

Keyboard shortcuts

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