github

package
v0.0.0-...-44422a2 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package github provides helpers for GitHub Actions references and API.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewLimiter

func NewLimiter(ctx context.Context, authenticated bool) *rate.Limiter

NewLimiter creates a new rate limiter for GitHub API calls. Authenticated: ~1.39 requests/second (5000/hour) with burst 10. Unauthenticated: 1 request/minute (60/hour) with burst 1.

Types

type ActionRef

type ActionRef struct {
	Owner   string
	Repo    string
	Version string
}

ActionRef represents a parsed GitHub Action reference "owner/repo@version".

func ParseActionRef

func ParseActionRef(uses string) (ref *ActionRef, err error)

ParseActionRef parses a GitHub Actions `uses` string like "owner/repo@v1".

func (ActionRef) String

func (a ActionRef) String() string

String returns the canonical "owner/repo@version" form of the action reference.

type Client

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

Client wraps the go-github client with a rate limiter and datastore.

func NewClient

func NewClient(ctx context.Context, cfg *config.Config) *Client

NewClient creates a new GitHub client using configuration.

func (*Client) FindLatestActionTag

func (gc *Client) FindLatestActionTag(
	ctx context.Context,
	action *ActionRef,
	opts ...FindLatestOption,
) (string, error)

FindLatestActionTag returns the latest tag for the given GitHub Action based on provided options.

type FindLatestOption

type FindLatestOption func(*findLatestOptions)

FindLatestOption configures how to select the latest tag for an action.

func WithExcludes

func WithExcludes(excludes map[string]struct{}) FindLatestOption

WithExcludes ignores any tags present in the provided set.

func WithUpdateOptions

func WithUpdateOptions(opts ...updater.Option) FindLatestOption

WithUpdateOptions forwards semver comparison options to the update strategy.

type Updater

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

Updater queries GitHub to find suitable latest action tags.

func NewUpdater

func NewUpdater(client *Client, opts ...FindLatestOption) Updater

NewUpdater constructs an Updater using the provided Client and options.

func (Updater) Update

func (u Updater) Update(
	ctx context.Context,
	action *ActionRef,
	opts ...update.Option,
) (string, error)

Update returns the latest tag for the given GitHub Action reference.

Jump to

Keyboard shortcuts

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