normalizeTemplatableModelFallbackEnabled adjusts a generated AWF config document for compile-time schema validation by coercing modelFallback.enabled GitHub Actions expressions to a boolean placeholder. GitHub Actions resolves these expressions at runtime before AWF consumes the config.
(doc any)
| 127 | // expressions to a boolean placeholder. GitHub Actions resolves these expressions at |
| 128 | // runtime before AWF consumes the config. |
| 129 | func normalizeTemplatableModelFallbackEnabled(doc any) { |
| 130 | root, ok := doc.(map[string]any) |
| 131 | if !ok { |
| 132 | return |
| 133 | } |
| 134 | apiProxy, ok := root["apiProxy"].(map[string]any) |
| 135 | if !ok { |
| 136 | return |
| 137 | } |
| 138 | modelFallback, ok := apiProxy["modelFallback"].(map[string]any) |
| 139 | if !ok { |
| 140 | return |
| 141 | } |
| 142 | enabled, ok := modelFallback["enabled"].(string) |
| 143 | if !ok || !isExpression(enabled) { |
| 144 | return |
| 145 | } |
| 146 | modelFallback["enabled"] = true |
| 147 | } |
| 148 | |
| 149 | // AWFConfigFile represents the AWF configuration file schema. |
| 150 | // This is the top-level structure written to awf-config.json. |
no test coverage detected