diff --git a/octo/actions/workflow.go b/octo/actions/workflow.go index 72bac7bb..da7225c9 100644 --- a/octo/actions/workflow.go +++ b/octo/actions/workflow.go @@ -28,14 +28,16 @@ type Workflow struct { Jobs map[string]Job `yaml:",omitempty"` } +// The ordering of the struct fields is intentional for better YAML readability after the marshalling +// Read more: https://github.com/paketo-buildpacks/pipeline-builder/pull/399 type Job struct { Name string `yaml:",omitempty"` + If string `yaml:",omitempty"` Needs []string `yaml:",omitempty"` RunsOn []VirtualEnvironment `yaml:"runs-on,omitempty"` Outputs map[string]string `yaml:",omitempty"` Env map[string]string `yaml:",omitempty"` Defaults Defaults `yaml:",omitempty"` - If string `yaml:",omitempty"` Steps []Step `yaml:",omitempty"` TimeoutMinutes int `yaml:",omitempty"` Strategy Strategy `yaml:",omitempty"` @@ -50,9 +52,9 @@ type Run struct { } type Step struct { - Id string `yaml:",omitempty"` - If string `yaml:",omitempty"` Name string `yaml:",omitempty"` + If string `yaml:",omitempty"` + Id string `yaml:",omitempty"` Uses string `yaml:",omitempty"` Run string `yaml:",omitempty"` WorkingDirectory string `yaml:"working-directory,omitempty"`