Documentation
¶
Overview ¶
Package source fetches immutable, public GitHub Action source archives.
Index ¶
- Constants
- func DigestTree(root string) (string, error)
- type Materialized
- type NotPublicError
- type Option
- func WithActionResolutionSnapshot(root string, refresh bool) Option
- func WithCacheMaxBytes(maxBytes int64) Option
- func WithGitHubAPITokenProvider(provider func(context.Context) (string, error)) Option
- func WithGitHubActionSourceTokenProvider(repository string, provider func(context.Context) (string, error)) Option
- func WithLimits(compressed, expanded, perFile int64, entries int) Option
- func WithTestEndpoints(apiBase string, codeloadBase ...string) Option
- func WithUserAgentVersion(version string) Option
- type RateLimitError
- type Reference
- type Resolved
- type Resolver
- type Store
Constants ¶
const (
// UnsupportedContainerActionReason explains the supported alternative to docker:// actions.
UnsupportedContainerActionReason = "docker:// container actions are unsupported; use a Dockerfile action or replace the action with a run step"
)
Variables ¶
This section is empty.
Functions ¶
func DigestTree ¶
DigestTree returns the canonical source digest for a local action directory. It uses the same bounded manifest and file-mode model as immutable remote action source. It rejects symlinks and other special files.
Types ¶
type Materialized ¶
type Materialized struct {
RepositoryRoot string
ActionRoot string
SourceDigest string
// contains filtered or unexported fields
}
Materialized identifies the immutable repository tree and selected action.
func (Materialized) Release ¶ added in v0.14.0
func (m Materialized) Release()
Release marks the materialized tree as no longer in use. Callers must release persistent-cache entries after reading them.
func (Materialized) Retain ¶ added in v0.14.0
func (m Materialized) Retain(ctx context.Context) (Materialized, error)
Retain acquires another lease for a memoized materialization.
type NotPublicError ¶
type NotPublicError struct{}
NotPublicError deliberately does not distinguish missing and private repositories.
func (*NotPublicError) Error ¶
func (*NotPublicError) Error() string
type Option ¶
type Option func(*config) error
Option configures trusted process-level limits or test endpoints. Options must never be populated from workflow input.
func WithActionResolutionSnapshot ¶ added in v0.14.0
WithActionResolutionSnapshot pins mutable refs to durable per-generation entries. Refresh starts a new generation without disrupting active readers.
func WithCacheMaxBytes ¶ added in v0.14.0
WithCacheMaxBytes bounds the immutable action-source cache. A materialized entry remains protected from eviction until its lease is released.
func WithGitHubAPITokenProvider ¶ added in v0.14.0
WithGitHubAPITokenProvider authenticates public action resolution without a repository-scoped token exception. It is intended for explicit local tools.
func WithGitHubActionSourceTokenProvider ¶ added in v0.12.0
func WithGitHubActionSourceTokenProvider(repository string, provider func(context.Context) (string, error)) Option
WithGitHubActionSourceTokenProvider authenticates mutable-ref API requests using a credential provisioned at the first such request and cached for this client. Returning an empty token selects anonymous resolution. Full lowercase SHAs never invoke the provider.
func WithLimits ¶
WithLimits lowers or raises trusted archive limits.
func WithTestEndpoints ¶
WithTestEndpoints replaces the API base and, when supplied, the direct codeload base. It exists for hermetic tests; production callers should use defaults.
func WithUserAgentVersion ¶ added in v0.30.0
WithUserAgentVersion identifies the buildkite-gha client making requests.
type RateLimitError ¶
RateLimitError reports anonymous GitHub API exhaustion.
func (*RateLimitError) Error ¶
func (e *RateLimitError) Error() string
type Reference ¶
type Reference struct{ Owner, Repository, Path, Ref, Raw string }
Reference is a parsed remote action reference.
type Resolver ¶
type Resolver struct {
// contains filtered or unexported fields
}
Resolver resolves public GitHub references, optionally using a credential only for GitHub API requests. Requests discard the client's cookie jar.
func (*Resolver) ResolutionSnapshotID ¶ added in v0.14.0
ResolutionSnapshotID identifies the immutable mutable-ref generation.
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store downloads exact public commits directly from codeload and atomically caches them in an existing real directory. A Store must not be shared by mutually untrusted processes writing the same cache root.
func NewStoreContext ¶ added in v0.26.0
func (*Store) Materialize ¶
Materialize returns the verified repository and selected action identity.