extractSecretsFromWorkflowFile parses a .lock.yml or .yml workflow file and returns the secret names declared in its on.workflow_call.secrets section.
(filePath string)
| 42 | // extractSecretsFromWorkflowFile parses a .lock.yml or .yml workflow file and returns |
| 43 | // the secret names declared in its on.workflow_call.secrets section. |
| 44 | func extractSecretsFromWorkflowFile(filePath string) ([]string, error) { |
| 45 | workflow, err := readWorkflowYAML(filePath) |
| 46 | if err != nil { |
| 47 | return nil, err |
| 48 | } |
| 49 | |
| 50 | secrets := extractWorkflowCallSecretsFromParsed(workflow) |
| 51 | callWorkflowSecretsLog.Printf("Extracted %d workflow_call secrets from %s", len(secrets), filePath) |
| 52 | return secrets, nil |
| 53 | } |
| 54 | |
| 55 | // extractWorkflowCallSecretsFromParsed extracts the secret names declared in |
| 56 | // on.workflow_call.secrets from an already-parsed workflow map. |
no test coverage detected