metadata

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2021 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package metadata loads main go file to a datastructure that describes Github action metadata.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ErrParse added in v0.0.9

type ErrParse struct {
	Pos token.Pos
	// contains filtered or unexported fields
}

type Input

type Input struct {
	Default  interface{} `yaml:",omitempty"`
	Desc     string      `yaml:"description,omitempty"`
	Required bool
	// contains filtered or unexported fields
}

Input for a Github action. See https://help.github.com/en/actions/building-actions/metadata-syntax-for-github-actions#inputs.

type Metadata

type Metadata struct {
	Name    string
	Desc    string        `yaml:"description,omitempty"`
	Inputs  yaml.MapSlice `yaml:",omitempty"` // map[string]Input
	Outputs yaml.MapSlice `yaml:",omitempty"` // map[string]Output
	Runs    Runs
	// Branding of Github action.
	// See https://help.github.com/en/actions/building-actions/metadata-syntax-for-github-actions#branding
	Branding struct {
		Icon  string `yaml:",omitempty"`
		Color string `yaml:",omitempty"`
	} `yaml:",omitempty"`
}

Metadata represents the structure of Github actions metadata yaml file. See https://help.github.com/en/actions/building-actions/metadata-syntax-for-github-actions.

func New

func New(pkg *ast.Package) (Metadata, error)

func (*Metadata) AddInput

func (m *Metadata) AddInput(name string, in Input)

func (*Metadata) AddOutput added in v0.0.7

func (m *Metadata) AddOutput(name string, out Output)

type Output added in v0.0.7

type Output struct {
	Desc string `yaml:"description"`
}

Output for Github action. See https://help.github.com/en/actions/building-actions/metadata-syntax-for-github-actions#outputs.

type Runs

type Runs struct {
	Using string // Alwasy "docker"
	Image string
	Env   yaml.MapSlice `yaml:",omitempty"` // map[string]string
	Args  []string      `yaml:",omitempty"`
}

Runs section for "Docker" Github action. See https://help.github.com/en/actions/building-actions/metadata-syntax-for-github-actions#runs-for-docker-actions.

Jump to

Keyboard shortcuts

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