(client *api.Client, host, owner, repo string)
| 345 | } |
| 346 | |
| 347 | func resolveDefaultBranch(client *api.Client, host, owner, repo string) (*ResolvedRef, error) { |
| 348 | apiPath := fmt.Sprintf("repos/%s/%s", url.PathEscape(owner), url.PathEscape(repo)) |
| 349 | var resp struct { |
| 350 | DefaultBranch string `json:"default_branch"` |
| 351 | } |
| 352 | if err := client.REST(host, "GET", apiPath, nil, &resp); err != nil { |
| 353 | return nil, fmt.Errorf("could not determine default branch: %w", err) |
| 354 | } |
| 355 | branch := resp.DefaultBranch |
| 356 | if branch == "" { |
| 357 | return nil, fmt.Errorf("could not determine default branch for %s/%s", owner, repo) |
| 358 | } |
| 359 | return resolveBranchRef(client, host, owner, repo, branch) |
| 360 | } |
| 361 | |
| 362 | // skillMatch represents a matched SKILL.md file and its convention. |
| 363 | type skillMatch struct { |
no test coverage detected