cicontext

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrWrongCIProvider = errors.New("wrong ci provider")
)

Functions

This section is empty.

Types

type BuildType

type BuildType string
const (
	PullRequest BuildType = "pull_request"
	Push        BuildType = "push"
)

type CIContext

type CIContext struct {
	Repo       string
	Owner      string
	CommitSHA  string
	BranchName string
}

func Detect

func Detect() (CIContext, error)

type CIProvider

type CIProvider interface {
	IsProvider() bool
	InferContext() (CIContext, error)
}

type GithubActionsDetector

type GithubActionsDetector struct{}

func (*GithubActionsDetector) InferContext

func (g *GithubActionsDetector) InferContext() (CIContext, error)

InferContext infers the CIContext using environment variables It assumes the correct provider was identified via IsProvider For more reference of what each environment variable represents, Check Github Action's documentation at https://docs.github.com/en/actions/learn-github-actions/environment-variables

func (*GithubActionsDetector) IsProvider

func (*GithubActionsDetector) IsProvider() bool

Jump to

Keyboard shortcuts

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