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

Function extractRunnerConfig

pkg/workflow/runner_config.go:13–36  ·  view source on GitHub ↗

extractRunnerConfig extracts runner topology configuration from frontmatter. Returns nil when no runner configuration is present.

(frontmatter map[string]any)

Source from the content-addressed store, hash-verified

11// extractRunnerConfig extracts runner topology configuration from frontmatter.
12// Returns nil when no runner configuration is present.
13func extractRunnerConfig(frontmatter map[string]any) *RunnerConfig {
14 runner, exists := frontmatter["runner"]
15 if !exists {
16 return nil
17 }
18
19 runnerObj, ok := runner.(map[string]any)
20 if !ok {
21 runnerConfigLog.Printf("runner field has unexpected type %T, expected object", runner)
22 return nil
23 }
24
25 config := &RunnerConfig{}
26 if topology, ok := runnerObj["topology"].(string); ok {
27 config.Topology = topology
28 runnerConfigLog.Printf("Runner topology: %s", topology)
29 }
30
31 if config.Topology == "" {
32 return nil
33 }
34
35 return config
36}
37
38// validateRunnerConfig validates the runner topology configuration.
39// It returns an error if the topology value is not recognized.

Callers 2

TestExtractRunnerConfigFunction · 0.85

Calls 1

PrintfMethod · 0.45

Tested by 1

TestExtractRunnerConfigFunction · 0.68