fix ci
This commit is contained in:
parent
91d12af9a9
commit
d3eabace79
2 changed files with 15 additions and 13 deletions
|
|
@ -402,16 +402,3 @@ func TestSkillsRegistriesConfigUnmarshalYAMLRetainsDefaultsForOmittedFields(t *t
|
|||
assert.Equal(t, "registry-token", github.AuthToken.String())
|
||||
assert.Empty(t, github.Param)
|
||||
}
|
||||
|
||||
func TestSkillsGithubConfigV0ToSkillsGithubConfigPreservesBaseURL(t *testing.T) {
|
||||
legacy := skillsGithubConfigV0{
|
||||
BaseURL: "https://ghe.example.com/git",
|
||||
Token: "ghp-test-token",
|
||||
Proxy: "http://127.0.0.1:7890",
|
||||
}
|
||||
|
||||
converted := legacy.ToSkillsGithubConfig()
|
||||
assert.Equal(t, "https://ghe.example.com/git", converted.BaseURL)
|
||||
assert.Equal(t, "ghp-test-token", converted.Token.String())
|
||||
assert.Equal(t, "http://127.0.0.1:7890", converted.Proxy)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -361,6 +361,21 @@ func loadConfigMap(path string) (map[string]any, error) {
|
|||
m["registries"] = map[string]any{"clawhub": m["clawhub"]}
|
||||
delete(m, "clawhub")
|
||||
}
|
||||
if gh, ok := m["github"].(map[string]any); ok {
|
||||
registries, _ := m["registries"].(map[string]any)
|
||||
if registries == nil {
|
||||
registries = map[string]any{}
|
||||
}
|
||||
githubRegistry := map[string]any{}
|
||||
for k, v := range gh {
|
||||
githubRegistry[k] = v
|
||||
}
|
||||
if token, ok := githubRegistry["token"]; ok {
|
||||
githubRegistry["auth_token"] = token
|
||||
}
|
||||
registries["github"] = githubRegistry
|
||||
m["registries"] = registries
|
||||
}
|
||||
}
|
||||
}
|
||||
m2["tools"] = m3
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue