metadata

package
v0.0.0-...-622e1da Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2024 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidValue = errors.New("invalid value for field 'permissions'")
)

Functions

func IsCallingReusableWorkflow

func IsCallingReusableWorkflow(job Job) bool

Types

type Action

type Action struct {
	Name         string      `yaml:"name"`
	DefaultToken string      `yaml:"default-token"`
	EnvKey       string      `yaml:"env-key"`
	Permissions  Permissions `yaml:"permissions"`
}

type ActionInput

type ActionInput struct {
	Input     string `yaml:"input"`
	IsDefault bool   `yaml:"is-default"`
}

type ActionMetadata

type ActionMetadata struct {
	Name             string            `yaml:"name"`
	GitHubToken      GitHubToken       `yaml:"github-token"`
	AllowedEndpoints []AllowedEndpoint `yaml:"outbound-endpoints"`
}

func GetActionKnowledgeBase

func GetActionKnowledgeBase(action string) (*ActionMetadata, error)

type ActionPermissions

type ActionPermissions struct {
	Actions Actions `yaml:"actions"`
}

type ActionScopePermission

type ActionScopePermission struct {
	Permission string
	Reason     string
	Expression string
}

type ActionScopePermissions

type ActionScopePermissions struct {
	Scopes map[string]ActionScopePermission
}

func (*ActionScopePermissions) UnmarshalYAML

func (p *ActionScopePermissions) UnmarshalYAML(unmarshal func(interface{}) error) error

type Actions

type Actions map[string]Action

type AllowedEndpoint

type AllowedEndpoint struct {
	FQDN   string `yaml:"fqdn"`
	Port   int    `yaml:"port"`
	Reason string `yaml:"reason"`
}

type Env

type Env map[string]string

type GitHubContent

type GitHubContent struct {
	Content string `json:"content"`
}

type GitHubToken

type GitHubToken struct {
	ActionInput             ActionInput            `yaml:"action-input"`
	EnvironmentVariableName string                 `yaml:"environment-variable-name"`
	Permissions             ActionScopePermissions `yaml:"permissions"`
}

type Job

type Job struct {
	Permissions Permissions `yaml:"permissions"`
	Uses        string      `yaml:"uses"`
	Env         Env         `yaml:"env"`
	// RunsOn      []string    `yaml:"runs-on"`
	Steps []Step `yaml:"steps"`
}

type Jobs

type Jobs map[string]Job

type Permissions

type Permissions struct {
	Scopes   map[string]string
	ReadAll  bool
	WriteAll bool
	IsSet    bool
}

func (*Permissions) UnmarshalYAML

func (p *Permissions) UnmarshalYAML(unmarshal func(interface{}) error) error

type Step

type Step struct {
	Run  string `yaml:"run"`
	Uses string `yaml:"uses"`
	With With   `yaml:"with"`
	Env  Env    `yaml:"env"`
}

type With

type With map[string]string

type Workflow

type Workflow struct {
	Name        string      `yaml:"name"`
	Permissions Permissions `yaml:"permissions"`
	//On   string `yaml:"on"`
	Env  Env  `yaml:"env"`
	Jobs Jobs `yaml:"jobs"`
}

Jump to

Keyboard shortcuts

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