Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve the ordering of GHA workflow fields #399

Merged
merged 2 commits into from
Oct 7, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions octo/actions/workflow.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
Expand All @@ -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"`
Expand Down