ParseRepoURL parses a repository URL stored in skill metadata.
(raw string)
| 18 | |
| 19 | // ParseRepoURL parses a repository URL stored in skill metadata. |
| 20 | func ParseRepoURL(raw string) (ghrepo.Interface, error) { |
| 21 | raw = strings.TrimSpace(raw) |
| 22 | if raw == "" { |
| 23 | return nil, fmt.Errorf("repository URL is empty") |
| 24 | } |
| 25 | |
| 26 | repo, err := ghrepo.FromFullName(raw) |
| 27 | if err != nil { |
| 28 | return nil, fmt.Errorf("invalid repository URL %q: %w", raw, err) |
| 29 | } |
| 30 | |
| 31 | return repo, nil |
| 32 | } |
| 33 | |
| 34 | // ParseMetadataRepo extracts repository information from skill metadata. |
| 35 | func ParseMetadataRepo(meta map[string]interface{}) (ghrepo.Interface, bool, error) { |
no test coverage detected