MCPcopy Create free account
hub / github.com/github/gh-aw / extractEngineIDForCodemod

Function extractEngineIDForCodemod

pkg/cli/codemod_engine_env_secrets.go:68–87  ·  view source on GitHub ↗
(frontmatter map[string]any, engineMap map[string]any)

Source from the content-addressed store, hash-verified

66}
67
68func extractEngineIDForCodemod(frontmatter map[string]any, engineMap map[string]any) string {
69 if id, ok := engineMap["id"].(string); ok && id != "" {
70 engineEnvSecretsCodemodLog.Printf("Extracted engine ID from engine.id: %s", id)
71 return id
72 }
73 if runtimeAny, hasRuntime := engineMap["runtime"]; hasRuntime {
74 if runtimeMap, ok := runtimeAny.(map[string]any); ok {
75 if id, ok := runtimeMap["id"].(string); ok && id != "" {
76 engineEnvSecretsCodemodLog.Printf("Extracted engine ID from engine.runtime.id: %s", id)
77 return id
78 }
79 }
80 }
81 if id, ok := frontmatter["engine"].(string); ok && id != "" {
82 engineEnvSecretsCodemodLog.Printf("Extracted engine ID from frontmatter engine field: %s", id)
83 return id
84 }
85 engineEnvSecretsCodemodLog.Print("No engine ID found, using empty string for secret key lookup")
86 return ""
87}
88
89func allowedEngineEnvSecretKeys(engineID string) map[string]struct {
90} {

Callers 1

Calls 2

PrintMethod · 0.80
PrintfMethod · 0.45

Tested by

no test coverage detected