vcs

package
v0.8.20230131140132 Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	GithubActionsBuildIdVersion = "v1"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Actions added in v0.8.20230131140132

type Actions struct {
	HostedIdSuffix     string
	SelfHostedIdSuffix string
	BuildType          string
}

func BuildId added in v0.8.20230131140132

func BuildId(version string) *Actions

BuildId The GitHub Actions team has not yet reviewed or approved this design, and it is not yet implemented. Details are subject to change!

type Context

type Context struct {
	Github Github
	Runner Runner
}

type ContextEnvironment

type ContextEnvironment interface {
	BuilderId() string
	BuildInvocationId() string
	BuildType() string
	Context() string
	CurrentFilteredEnvironment() map[string]string
	NonReproducibleMetadata() *Metadata
	UserDefinedParameters() *Event
	RepoUri() string
	Sha() string
	GetEvent() *Event
}

func BuildEnvironment

func BuildEnvironment(context *GithubContext, runner *RunnerContext, current *CurrentBuildEnvironment, event *Event) ContextEnvironment

func CreateGithubCIEnvironment

func CreateGithubCIEnvironment(githubContext []byte, runnerContext, envsContext *string) (ContextEnvironment, error)

func ResolveBuildContext

func ResolveBuildContext(context, runner, env *string) (ContextEnvironment, error)

type ContextType

type ContextType string
const (
	ContextTypeGithub ContextType = "GITHUB_ACTIONS"
)

func (ContextType) Hosted

func (in ContextType) Hosted() bool

func (ContextType) String

func (in ContextType) String() string

type CurrentBuildEnvironment added in v0.8.20230131140132

type CurrentBuildEnvironment struct {
	Envs map[string]string
}

func ParseBuild added in v0.8.20230131140132

func ParseBuild(envs *string) (*CurrentBuildEnvironment, error)

func (*CurrentBuildEnvironment) FilterEnvs added in v0.8.20230131140132

func (in *CurrentBuildEnvironment) FilterEnvs() map[string]string

func (*CurrentBuildEnvironment) GetEnvs added in v0.8.20230131140132

func (in *CurrentBuildEnvironment) GetEnvs() map[string]string

type Event

type Event struct {
	EventMetadata *EventMetadata `json:"event"`
}

func ParseEvent added in v0.8.20230131140132

func ParseEvent(inputs []byte) (*Event, error)

func (*Event) GetHeadCommitTimestamp added in v0.8.20230131140132

func (in *Event) GetHeadCommitTimestamp() string

type EventMetadata added in v0.8.20230131140132

type EventMetadata struct {
	HeadCommit  *HeadCommit  `json:"head_commit"`
	PullRequest *PullRequest `json:"pull_request"`
	WorkFlowRun *WorkFlow    `json:"workflow_run"`
}

type Github

type Github struct {
	RunId string
}

type GithubCIEnvironment

type GithubCIEnvironment struct {
	BuildContext     *GithubContext
	Event            *Event
	RunnerContext    *RunnerContext
	BuildEnvironment *CurrentBuildEnvironment
	Actions          *Actions
}

func (*GithubCIEnvironment) BuildInvocationId

func (in *GithubCIEnvironment) BuildInvocationId() string

func (*GithubCIEnvironment) BuildType

func (in *GithubCIEnvironment) BuildType() string

func (*GithubCIEnvironment) BuilderId

func (in *GithubCIEnvironment) BuilderId() string

func (*GithubCIEnvironment) Context

func (in *GithubCIEnvironment) Context() string

func (*GithubCIEnvironment) CurrentFilteredEnvironment

func (in *GithubCIEnvironment) CurrentFilteredEnvironment() map[string]string

func (*GithubCIEnvironment) GetEvent added in v0.8.20230131140132

func (in *GithubCIEnvironment) GetEvent() *Event

func (*GithubCIEnvironment) NonReproducibleMetadata

func (in *GithubCIEnvironment) NonReproducibleMetadata() *Metadata

func (*GithubCIEnvironment) RepoUri

func (in *GithubCIEnvironment) RepoUri() string

func (*GithubCIEnvironment) Sha

func (in *GithubCIEnvironment) Sha() string

func (*GithubCIEnvironment) UserDefinedParameters

func (in *GithubCIEnvironment) UserDefinedParameters() *Event

type GithubContext added in v0.8.20230131140132

type GithubContext struct {
	Action          string          `json:"action"`
	Actor           string          `json:"actor"`
	Event           json.RawMessage `json:"event"`
	EventName       string          `json:"event_name"`
	EventPath       string          `json:"event_path"`
	Job             string          `json:"job"`
	Ref             string          `json:"ref"`
	Repository      string          `json:"repository"`
	RepositoryOwner string          `json:"repository_owner"`
	RunId           string          `json:"run_id"`
	RunNumber       string          `json:"run_number"`
	ServerUrl       string          `json:"server_url"`
	SHA             string          `json:"sha"`
	Token           string          `json:"token,omitempty"`
	Workflow        string          `json:"workflow"`
	Workspace       string          `json:"workspace"`
}

func ParseContext added in v0.8.20230131140132

func ParseContext(github []byte) (*GithubContext, error)

type HeadCommit added in v0.8.20230131140132

type HeadCommit struct {
	Timestamp string `json:"timestamp"`
}

type Metadata

type Metadata struct {
	Arch    string            `json:"arch"`
	Env     map[string]string `json:"env"`
	Context Context           `json:"context"`
}

type PullRequest added in v0.8.20230131140132

type PullRequest struct {
	UpdatedAt string `json:"updated_at"`
}

type Runner

type Runner struct {
	Os   string
	Temp string
}

type RunnerContext added in v0.8.20230131140132

type RunnerContext struct {
	Name      string `json:"name"`
	Arch      string `json:"arch"`
	OS        string `json:"os"`
	Temp      string `json:"temp"`
	ToolCache string `json:"tool_cache"`
}

func ParseRunner added in v0.8.20230131140132

func ParseRunner(runner *string) (*RunnerContext, error)

type WorkFlow added in v0.8.20230131140132

type WorkFlow struct {
	HeadCommit *HeadCommit `json:"head_commit"`
}

Jump to

Keyboard shortcuts

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