ExtractSecretsFromMap extracts all secrets from a map of string values Returns a map of environment variable names to their full secret expressions Example: Input: {"DD_API_KEY": "${{ secrets.DD_API_KEY }}", "DD_SITE": "${{ secrets.DD_SITE || 'default' }}"} Output: {"DD_API_KEY": "${{ secrets.DD_
(values map[string]string)
| 80 | // Input: {"DD_API_KEY": "${{ secrets.DD_API_KEY }}", "DD_SITE": "${{ secrets.DD_SITE || 'default' }}"} |
| 81 | // Output: {"DD_API_KEY": "${{ secrets.DD_API_KEY }}", "DD_SITE": "${{ secrets.DD_SITE || 'default' }}"} |
| 82 | func ExtractSecretsFromMap(values map[string]string) map[string]string { |
| 83 | secretLog.Printf("Extracting secrets from map with %d entries", len(values)) |
| 84 | allSecrets := make(map[string]string) |
| 85 | |
| 86 | for _, value := range values { |
| 87 | secrets := ExtractSecretsFromValue(value) |
| 88 | maps.Copy(allSecrets, secrets) |
| 89 | } |
| 90 | |
| 91 | secretLog.Printf("Extracted total of %d unique secrets from map", len(allSecrets)) |
| 92 | return allSecrets |
| 93 | } |
| 94 | |
| 95 | // ExtractEnvExpressionsFromMap extracts all env variable expressions from a map of string values |
| 96 | // Returns a map of environment variable names to their full env expressions (including fallbacks) |