FetchLatestRelease finds the latest published release for a repository.
(ctx context.Context, httpClient *http.Client, repo ghrepo.Interface)
| 235 | |
| 236 | // FetchLatestRelease finds the latest published release for a repository. |
| 237 | func FetchLatestRelease(ctx context.Context, httpClient *http.Client, repo ghrepo.Interface) (*Release, error) { |
| 238 | url, err := safeurl.JoinPathWithHostPrefix(ghinstance.RESTPrefix(repo.RepoHost()), "repos", repo.RepoOwner(), repo.RepoName(), "releases", "latest") |
| 239 | if err != nil { |
| 240 | return nil, err |
| 241 | } |
| 242 | return fetchReleasePath(ctx, httpClient, url) |
| 243 | } |
| 244 | |
| 245 | // fetchDraftRelease returns the first draft release that has tagName as its pending tag. |
| 246 | func fetchDraftRelease(ctx context.Context, httpClient *http.Client, repo ghrepo.Interface, tagName string) (*Release, error) { |
no test coverage detected