hasNonEmptyWorkflowRunWorkflows returns true when workflow_run.workflows includes at least one non-empty workflow name. Supported types: - string: valid when non-empty after trimming whitespace - []string: valid when any item is non-empty after trimming whitespace - []any: valid when any string ite
(v any)
| 345 | // |
| 346 | // For all other types, it returns false. |
| 347 | func hasNonEmptyWorkflowRunWorkflows(v any) bool { |
| 348 | switch workflows := v.(type) { |
| 349 | case string: |
| 350 | return strings.TrimSpace(workflows) != "" |
| 351 | case []string: |
| 352 | for _, workflow := range workflows { |
| 353 | if strings.TrimSpace(workflow) != "" { |
| 354 | return true |
| 355 | } |
| 356 | } |
| 357 | return false |
| 358 | case []any: |
| 359 | for _, workflow := range workflows { |
| 360 | s, ok := workflow.(string) |
| 361 | if ok && strings.TrimSpace(s) != "" { |
| 362 | return true |
| 363 | } |
| 364 | } |
| 365 | return false |
| 366 | default: |
| 367 | return false |
| 368 | } |
| 369 | } |
no outgoing calls
no test coverage detected