mirror of
https://gitea.com/gitea/runner.git
synced 2026-11-13 03:13:42 +00:00
Remove empty steps when decoding Job (#49)
Follow #48 Empty steps are invalid, so remove them when decoding `Job` from YAML. Reviewed-on: https://gitea.com/gitea/act/pulls/49 Reviewed-by: Jason Song <[email protected]> Co-authored-by: Zettat123 <[email protected]> Co-committed-by: Zettat123 <[email protected]>
This commit is contained in:
1 parent
6b1010ad07
commit
721857e4a0
4 files changed
+27
No files matched your search
@@ -40,6 +40,13 @@ func (w *SingleWorkflow) jobs() ([]string, []*Job, error) {
|
||||
if err := item.Decode(job); err != nil {
|
||||
return nil, nil, fmt.Errorf("yaml.Unmarshal: %w", err)
|
||||
}
|
||||
steps := make([]*Step, 0, len(job.Steps))
|
||||
for _, s := range job.Steps {
|
||||
if s != nil {
|
||||
steps = append(steps, s)
|
||||
}
|
||||
}
|
||||
job.Steps = steps
|
||||
jobs = append(jobs, job)
|
||||
expectKey = true
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user