actioncache

package
v0.2.13 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2026 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Overview

Package actioncache keeps a host-local cache of GitHub Action archives in the layout the actions runner reads through ACTIONS_RUNNER_ACTION_ARCHIVE_CACHE: <dir>/<owner>_<repo>/<sha>.tar.gz. The runner only reads it, so the agent fills it after each job from the actions that job's log says it downloaded.

Index

Constants

View Source
const DefaultMaxBytes = 2 << 30

DefaultMaxBytes caps the cache; the oldest archives go first past it.

View Source
const DirName = "actions"

DirName is the cache's directory under the agent state dir. The VM CLIs name a guest share after the host folder, so this is also its name in the guest.

View Source
const EnvVar = "ACTIONS_RUNNER_ACTION_ARCHIVE_CACHE"

EnvVar points the runner at the cache directory.

Variables

This section is empty.

Functions

func Path

func Path(dir, repo, sha string) string

Path is where the runner looks for repo's archive at sha.

Types

type Action

type Action struct {
	Repo string // owner/repo
	SHA  string
}

Action is one action repository at a resolved commit.

func Parse

func Parse(r io.Reader) ([]Action, error)

Parse returns the distinct actions a job log's setup section reports downloading, in order, at most maxActions. A subpath action (owner/repo/path) is cached under its repository.

type Cache

type Cache struct {
	Dir      string
	MaxBytes int64
	// contains filtered or unexported fields
}

Cache fills and trims one host's archive directory.

func New

func New(dir string, client func(scope string) *github.Client) (*Cache, error)

New creates dir and returns a cache whose fills authenticate with the job scope's App client.

func (*Cache) Fill

func (c *Cache) Fill(job domain.Job)

Fill schedules a cache fill from a finished job. It never blocks: a full queue drops the job, which costs a later download, not a job.

func (*Cache) Reclaim

func (c *Cache) Reclaim() error

Reclaim empties the cache for disk-pressure reclaim. It removes the entries, not the directory, so live runner mounts of it stay valid.

func (*Cache) Run

func (c *Cache) Run(ctx context.Context)

Run works the fill queue until ctx is cancelled.

Jump to

Keyboard shortcuts

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