github

package
v2.0.0-...-ecf2c05 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2026 License: MIT Imports: 28 Imported by: 0

Documentation

Overview

Package github downloads action and reusable-workflow metadata using the configured network mode, credentials and cache directory.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GitHub

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

func New

func New(options Options) (*GitHub, error)

func (*GitHub) Lookup

func (g *GitHub) Lookup(ctx context.Context, ref actions.Reference) (actions.Manifest, error)

Lookup natively acquires only full SHA-1 commit requests. Named refs require an injected action-profile resolver; the commits API never selects their ref.

func (*GitHub) LookupWorkflow

func (g *GitHub) LookupWorkflow(ctx context.Context, spec string) (workflows.RemoteFile, error)

LookupWorkflow uses workflow reference selection and the same HTTP client, request accounting and immutable cache checks as action metadata.

func (*GitHub) Open

func (g *GitHub) Open(ctx context.Context, request references.Request) (repository.Session, error)

Open checks repository identity and read access before resolving references.

func (*GitHub) ResolverEnabled

func (g *GitHub) ResolverEnabled() bool

func (*GitHub) WithMetadataMirrors

func (g *GitHub) WithMetadataMirrors(access references.MirrorAccess, excludedRepositories []string) actions.Provider

func (*GitHub) WithResolver

func (g *GitHub) WithResolver(resolver references.Resolver) actions.Provider

WithResolver uses the analysis session's resolver for action and workflow lookups.

func (*GitHub) WithWorkflowMetadataMirrors

func (g *GitHub) WithWorkflowMetadataMirrors(access references.MirrorAccess, excludedRepositories []string) workflows.Provider

type Mode

type Mode string
const (
	Off     Mode = "off"
	Offline Mode = "offline"
	Online  Mode = "online"
)

type Options

type Options struct {
	Mode      Mode
	CacheDir  string
	Token     string
	Resolver  func() references.Resolver
	Transport http.RoundTripper
	Mirrors   references.MirrorAccess
}

Options selects acquisition explicitly. Tokens are never cached or included in returned failures. A supplied resolver must retain action selection routes.

func EnvironmentOptions

func EnvironmentOptions(mode Mode, env func(string) string, userCacheDir string) Options

EnvironmentOptions uses the user's cache and GitHub credentials for metadata lookups.

Jump to

Keyboard shortcuts

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