forgeactions

package
v0.7.3 Latest Latest
Warning

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

Go to latest
Published: May 4, 2023 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultNode12ImageReference is the default image to use
	// when an action specifies that it runs using "node12".
	DefaultNode12ImageReference = "docker.io/library/node:12"
	// DefaultNode16ImageReference is the default image to use
	// when an action specifies that it runs using "node16".
	DefaultNode16ImageReference = "docker.io/library/node:16"
)

Variables

View Source
var (
	DefaultRootPath         = containerfs.WorkingDir
	DefaultWorkspace        = DefaultRootPath + "/workspace"
	DefaultActionPath       = DefaultRootPath + "/action"
	DefaultRunnerPath       = DefaultRootPath + "/runner"
	DefaultRunnerTemp       = DefaultRunnerPath + "/tmp"
	DefaultRunnerToolCache  = DefaultRunnerPath + "/toolcache"
	DefaultGitHubPath       = DefaultRootPath + "/github"
	DefaultGitHubPathPath   = DefaultGitHubPath + "/add_path"
	DefaultGitHubEnvPath    = DefaultGitHubPath + "/set_env"
	DefaultGitHubOutputPath = DefaultGitHubPath + "/set_output"
	DefaultGitHubStatePath  = DefaultGitHubPath + "/save_state"
)
View Source
var (
	// Node12ImageReference is the image to use when an action
	// when an action specifies that it runs using "node12".
	// var so as to be overridable.
	Node12ImageReference = DefaultNode12ImageReference
	// Node16ImageReference is the image to use when an action
	// when an action specifies that it runs using "node16".
	// var so as to be overridable.
	Node16ImageReference = DefaultNode16ImageReference
)
View Source
var DefaultMapping = &Mapping{
	Workspace:        DefaultWorkspace,
	ActionPath:       DefaultActionPath,
	RunnerTemp:       DefaultRunnerTemp,
	RunnerToolCache:  DefaultRunnerToolCache,
	GitHubPath:       DefaultGitHubPath,
	GitHubPathPath:   DefaultGitHubPathPath,
	GitHubEnvPath:    DefaultGitHubEnvPath,
	GitHubOutputPath: DefaultGitHubOutputPath,
	GitHubStatePath:  DefaultGitHubStatePath,
}
View Source
var ErrCantBuildDockerfile = errors.New("runtime can't build Dockerfile")

Functions

func ActionToConfigs

func ActionToConfigs(globalContext *githubactions.GlobalContext, uses *githubactions.Uses, with, environment map[string]string, actionMetadata *githubactions.Metadata, image forge.Image) ([]forge.ContainerConfig, error)

func ConfigureGlobalContext

func ConfigureGlobalContext(globalContext *githubactions.GlobalContext) *githubactions.GlobalContext

func GetImageForMetadata

func GetImageForMetadata(ctx context.Context, containerRuntime forge.ContainerRuntime, actionMetadata *githubactions.Metadata, uses *githubactions.Uses) (forge.Image, error)

func GetUsesMetadata

func GetUsesMetadata(ctx context.Context, uses *githubactions.Uses) (*githubactions.Metadata, error)

func MetadataToImageReference

func MetadataToImageReference(actionMetadata *githubactions.Metadata) string

func NewWorkflowCommandStreams

func NewWorkflowCommandStreams(globalContext *githubactions.GlobalContext, id string, drains *forge.Drains) *forge.Streams

func SetGlobalContextFromEnvFiles added in v0.5.0

func SetGlobalContextFromEnvFiles(ctx context.Context, globalContext *githubactions.GlobalContext, step string, container forge.Container) error

func UsesToActionDirectory

func UsesToActionDirectory(uses *githubactions.Uses) (string, error)

func UsesToRootDirectory

func UsesToRootDirectory(uses *githubactions.Uses) (string, error)

Types

type ImageBuilder

type ImageBuilder interface {
	BuildDockerfile(context.Context, string, string) (forge.Image, error)
}

type Mapping

type Mapping struct {
	ActionPath       string
	Workspace        string
	RunnerToolCache  string
	RunnerTemp       string
	GitHubPath       string
	GitHubPathPath   string
	GitHubEnvPath    string
	GitHubOutputPath string
	GitHubStatePath  string
}

func (*Mapping) ActionToConfigs

func (m *Mapping) ActionToConfigs(globalContext *githubactions.GlobalContext, uses *githubactions.Uses, with, environment map[string]string, actionMetadata *githubactions.Metadata, image forge.Image) ([]forge.ContainerConfig, error)

func (*Mapping) ConfigureGlobalContext

func (m *Mapping) ConfigureGlobalContext(globalContext *githubactions.GlobalContext) *githubactions.GlobalContext

func (*Mapping) GetImageForMetadata

func (m *Mapping) GetImageForMetadata(ctx context.Context, containerRuntime forge.ContainerRuntime, actionMetadata *githubactions.Metadata, uses *githubactions.Uses) (forge.Image, error)

func (*Mapping) GetUsesMetadata

func (m *Mapping) GetUsesMetadata(ctx context.Context, uses *githubactions.Uses) (*githubactions.Metadata, error)

func (*Mapping) SetGlobalContextFromEnvFiles added in v0.5.0

func (m *Mapping) SetGlobalContextFromEnvFiles(ctx context.Context, globalContext *githubactions.GlobalContext, step string, container forge.Container) error

func (*Mapping) UsesToActionDirectory

func (m *Mapping) UsesToActionDirectory(uses *githubactions.Uses) (string, error)

func (*Mapping) UsesToRootDirectory

func (m *Mapping) UsesToRootDirectory(uses *githubactions.Uses) (string, error)

type WorkflowCommandWriter

type WorkflowCommandWriter struct {
	*githubactions.GlobalContext
	ID                         string
	StopCommandsTokens         map[string]bool
	Debug                      bool
	SaveStateDeprecationWarned bool
	SetOutputDeprecationWarned bool
}

func (*WorkflowCommandWriter) Callback

Jump to

Keyboard shortcuts

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