MCPcopy
hub / github.com/cli/cli / ParseMetadataRepo

Function ParseMetadataRepo

internal/skills/source/source.go:35–51  ·  view source on GitHub ↗

ParseMetadataRepo extracts repository information from skill metadata.

(meta map[string]interface{})

Source from the content-addressed store, hash-verified

33
34// ParseMetadataRepo extracts repository information from skill metadata.
35func ParseMetadataRepo(meta map[string]interface{}) (ghrepo.Interface, bool, error) {
36 if meta == nil {
37 return nil, false, nil
38 }
39
40 repoValue, _ := meta["github-repo"].(string)
41 if repoValue == "" {
42 return nil, false, nil
43 }
44
45 repo, err := ParseRepoURL(repoValue)
46 if err != nil {
47 return nil, true, err
48 }
49
50 return repo, true, nil
51}
52
53// ValidateSupportedHost rejects hosts that are not supported.
54// Supported hosts are github.com and GHEC with data residency (*.ghe.com).

Callers 3

parseInstalledSkillFunction · 0.92
existingSkillPromptFunction · 0.92
TestParseMetadataRepoFunction · 0.85

Calls 1

ParseRepoURLFunction · 0.85

Tested by 1

TestParseMetadataRepoFunction · 0.68