parser

package
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: Dec 27, 2025 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseWorkflowYAML

func ParseWorkflowYAML(workflow *WorkflowFile) error

ParseWorkflowYAML parses a workflow file's YAML content

Types

type Job

type Job struct {
	Name            string                 `yaml:"name,omitempty"`
	RunsOn          interface{}            `yaml:"runs-on"`
	Permissions     interface{}            `yaml:"permissions,omitempty"`
	Needs           interface{}            `yaml:"needs,omitempty"`
	If              string                 `yaml:"if,omitempty"`
	Steps           []Step                 `yaml:"steps"`
	Env             map[string]string      `yaml:"env,omitempty"`
	Defaults        map[string]interface{} `yaml:"defaults,omitempty"`
	ContinueOnError bool                   `yaml:"continue-on-error,omitempty"`
	Container       interface{}            `yaml:"container,omitempty"`
	Services        map[string]interface{} `yaml:"services,omitempty"`
	Strategy        map[string]interface{} `yaml:"strategy,omitempty"`
	Outputs         map[string]string      `yaml:"outputs,omitempty"`
}

Job represents a job in a GitHub Actions workflow

type Step

type Step struct {
	Name             string                 `yaml:"name,omitempty"`
	ID               string                 `yaml:"id,omitempty"`
	If               string                 `yaml:"if,omitempty"`
	Uses             string                 `yaml:"uses,omitempty"`
	Run              string                 `yaml:"run,omitempty"`
	Shell            string                 `yaml:"shell,omitempty"`
	With             map[string]interface{} `yaml:"with,omitempty"`
	Env              map[string]string      `yaml:"env,omitempty"`
	ContinueOnError  bool                   `yaml:"continue-on-error,omitempty"`
	WorkingDirectory string                 `yaml:"working-directory,omitempty"`
}

Step represents a step in a GitHub Actions job

type Workflow

type Workflow struct {
	Name        string                 `yaml:"name"`
	On          interface{}            `yaml:"on"`
	Env         map[string]string      `yaml:"env,omitempty"`
	Jobs        map[string]Job         `yaml:"jobs"`
	Permissions interface{}            `yaml:"permissions,omitempty"`
	Defaults    map[string]interface{} `yaml:"defaults,omitempty"`
}

Workflow represents the parsed structure of a GitHub Actions workflow file

type WorkflowFile

type WorkflowFile struct {
	Path     string
	Name     string
	Content  []byte
	Workflow Workflow
}

WorkflowFile represents a GitHub Actions workflow file

func FindWorkflows

func FindWorkflows(repoPath string) ([]WorkflowFile, error)

FindWorkflows searches for GitHub Actions workflow files in a repository

func LoadSingleWorkflow

func LoadSingleWorkflow(filePath string) ([]WorkflowFile, error)

LoadSingleWorkflow loads and parses a single workflow file

Jump to

Keyboard shortcuts

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