| 570 | } |
| 571 | |
| 572 | func getGitHubDockerImageVersion(githubTool map[string]any) string { |
| 573 | githubDockerImageVersion := string(constants.DefaultGitHubMCPServerVersion) // Default Docker image version |
| 574 | // Extract version setting from tool properties |
| 575 | if versionSetting, exists := githubTool["version"]; exists { |
| 576 | // Handle different version types |
| 577 | switch v := versionSetting.(type) { |
| 578 | case string: |
| 579 | githubDockerImageVersion = v |
| 580 | case int: |
| 581 | githubDockerImageVersion = strconv.Itoa(v) |
| 582 | case int64: |
| 583 | githubDockerImageVersion = strconv.FormatInt(v, 10) |
| 584 | case uint64: |
| 585 | githubDockerImageVersion = strconv.FormatUint(v, 10) |
| 586 | case float64: |
| 587 | // Use %g to avoid trailing zeros and scientific notation for simple numbers |
| 588 | githubDockerImageVersion = fmt.Sprintf("%g", v) |
| 589 | } |
| 590 | } |
| 591 | githubConfigLog.Printf("GitHub MCP Docker image version: %s", githubDockerImageVersion) |
| 592 | return githubDockerImageVersion |
| 593 | } |