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

Function parseStartupTimeoutTool

pkg/workflow/tools_parser.go:570–595  ·  view source on GitHub ↗

parseStartupTimeoutTool converts raw startup-timeout tool configuration to a TemplatableInt32 value. Accepts integers and GitHub Actions expressions (e.g. "${{ inputs.startup-timeout }}").

(val any)

Source from the content-addressed store, hash-verified

568// parseStartupTimeoutTool converts raw startup-timeout tool configuration to a TemplatableInt32 value.
569// Accepts integers and GitHub Actions expressions (e.g. "${{ inputs.startup-timeout }}").
570func parseStartupTimeoutTool(val any) *TemplatableInt32 {
571 switch v := val.(type) {
572 case int:
573 t := TemplatableInt32(strconv.Itoa(v))
574 return &t
575 case int64:
576 t := TemplatableInt32(strconv.FormatInt(v, 10))
577 return &t
578 case uint:
579 t := TemplatableInt32(strconv.FormatUint(uint64(v), 10))
580 return &t
581 case uint64:
582 t := TemplatableInt32(strconv.FormatUint(v, 10))
583 return &t
584 case float64:
585 t := TemplatableInt32(strconv.Itoa(int(v)))
586 return &t
587 case string:
588 if isExpression(v) {
589 t := TemplatableInt32(v)
590 return &t
591 }
592 return nil // reject non-expression strings
593 }
594 return nil
595}
596
597// parseMCPServerConfig converts raw MCP server configuration to MCPServerConfig
598func parseMCPServerConfig(val any) MCPServerConfig {

Callers 1

NewToolsFunction · 0.85

Calls 2

TemplatableInt32TypeAlias · 0.85
isExpressionFunction · 0.85

Tested by

no test coverage detected