github

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package github provides GitHub CLI (gh) wrapper functions.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckGHAvailable

func CheckGHAvailable() error

CheckGHAvailable verifies the gh CLI is installed and authenticated.

func UpdateReleaseBody

func UpdateReleaseBody(tag, notesFile string) error

UpdateReleaseBody updates the release notes for a given tag.

Types

type Release

type Release struct {
	TagName      string    `json:"tagName"`
	PublishedAt  time.Time `json:"publishedAt"`
	IsDraft      bool      `json:"isDraft"`
	IsPrerelease bool      `json:"isPrerelease"`
}

Release represents a GitHub release.

func FindPreviousRelease

func FindPreviousRelease(releases []Release, tag string, tagValidator func(string) bool) (*Release, error)

FindPreviousRelease finds the release published immediately before the given tag. The tagValidator function is used to filter releases to only those with valid git tags. Returns nil (without error) if no valid previous release is found.

func GetLatestRelease

func GetLatestRelease(releases []Release) (*Release, error)

GetLatestRelease returns the most recently published release.

func ListReleases

func ListReleases() ([]Release, error)

ListReleases returns all releases for the current repository.

type RepoInfo

type RepoInfo struct {
	Name          string `json:"name"`
	NameWithOwner string `json:"nameWithOwner"`
}

RepoInfo holds the repository metadata from gh repo view.

func GetRepoInfo

func GetRepoInfo() (*RepoInfo, error)

GetRepoInfo returns the repository name and owner/name in a single gh call.

Jump to

Keyboard shortcuts

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