forgeactions

package
v0.2.4 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2022 License: MIT Imports: 10 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 + "/path.txt"
	DefaultGitHubEnvPath   = DefaultGitHubPath + "/env.txt"
)
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,
}

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 added in v0.2.2

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 UsesToActionDirectory

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

func UsesToRootDirectory

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

Types

type Mapping

type Mapping struct {
	ActionPath      string `json:"action_path,omitempty"`
	Workspace       string `json:"workspace,omitempty"`
	RunnerToolCache string `json:"runner_tool_cache,omitempty"`
	RunnerTemp      string `json:"runner_temp,omitempty"`
	GitHubPath      string `json:"git_hub_path,omitempty"`
	GitHubPathPath  string `json:"git_hub_path_path,omitempty"`
	GitHubEnvPath   string `json:"git_hub_env_path,omitempty"`
}

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 added in v0.2.2

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) UsesToActionDirectory

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

func (*Mapping) UsesToRootDirectory

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

type WorkflowCommandWriter added in v0.2.0

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

func (*WorkflowCommandWriter) Callback added in v0.2.0

Jump to

Keyboard shortcuts

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