parseNeedsField parses the needs field from a job configuration The needs field can be a string (single dependency) or an array of strings
(needsField any)
| 243 | // parseNeedsField parses the needs field from a job configuration |
| 244 | // The needs field can be a string (single dependency) or an array of strings |
| 245 | func parseNeedsField(needsField any) []string { |
| 246 | // GitHub Actions allows `needs: "single-dep"` as shorthand for `needs: ["single-dep"]` |
| 247 | if s, ok := needsField.(string); ok { |
| 248 | return []string{s} |
| 249 | } |
| 250 | result := parseStringSliceAny(needsField, nil) |
| 251 | if result == nil { |
| 252 | return []string{} |
| 253 | } |
| 254 | return result |
| 255 | } |