Documentation
¶
Overview ¶
Package ghworkflow is Scorecard's model of a GitHub Actions workflow file.
Checks and probes consume only the types in this package. The YAML parsing itself is delegated to an external parser, which is confined to convert.go so it can be replaced without touching any consumer.
Index ¶
- func Parse(content []byte) (*Workflow, []*Error)
- type Defaults
- type DefaultsRun
- type Env
- type EnvVar
- type Error
- type Event
- type Exec
- type ExecAction
- type ExecKind
- type ExecRun
- type Input
- type Job
- type Matrix
- type MatrixAssign
- type MatrixCombination
- type MatrixCombinations
- type MatrixRow
- type PermissionScope
- type Permissions
- type Pos
- type Runner
- type Step
- type Strategy
- type String
- type Workflow
- type WorkflowCall
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type DefaultsRun ¶
type DefaultsRun struct {
Shell *String
}
DefaultsRun is the `defaults.run:` section.
type Exec ¶
type Exec interface {
Kind() ExecKind
}
Exec is what a step executes: either an *ExecAction or an *ExecRun.
type ExecAction ¶
ExecAction is a step that runs an action. Inputs holds its `with:` values, keyed by input name.
type Job ¶
type Job struct {
ID *String
Name *String
RunsOn *Runner
Permissions *Permissions
Env *Env
Defaults *Defaults
Strategy *Strategy
WorkflowCall *WorkflowCall
Pos *Pos
Steps []*Step
}
Job is a single entry under `jobs:`.
type Matrix ¶
type Matrix struct {
Rows map[string]*MatrixRow
Include *MatrixCombinations
}
Matrix is a job's `strategy.matrix:` section.
type MatrixAssign ¶
MatrixAssign is a single `key: value` pair in a matrix combination. Value follows the same rendering rules as MatrixRow.Values.
type MatrixCombination ¶
type MatrixCombination struct {
Assigns map[string]*MatrixAssign
}
MatrixCombination is one entry of a matrix `include:` list. Assigns is keyed by the assigned key's name.
type MatrixCombinations ¶
type MatrixCombinations struct {
Combinations []*MatrixCombination
}
MatrixCombinations is a matrix `include:` list.
type MatrixRow ¶
MatrixRow is one matrix dimension, such as `os: [ubuntu-latest, windows-latest]`. String values are stored unquoted; arrays and objects are stored in a flow-style rendering.
type PermissionScope ¶
PermissionScope is a single `<scope>: <level>` entry in a permissions mapping.
type Permissions ¶
type Permissions struct {
All *String
Scopes map[string]*PermissionScope
Pos *Pos
}
Permissions is a `permissions:` section. All is set when the section is a single string such as "read-all"; Scopes is set when it is a mapping.
type Runner ¶
Runner is a job's `runs-on:` value. When it is a single `${{ }}` expression, LabelsExpr is set instead of Labels.
type Workflow ¶
type Workflow struct {
Permissions *Permissions
Env *Env
Jobs map[string]*Job
On []*Event
}
Workflow is a parsed workflow file. Fields are nil when the corresponding section is absent.
type WorkflowCall ¶
type WorkflowCall struct {
Uses *String
}
WorkflowCall is a job that calls a reusable workflow with `uses:`.