MCPcopy
hub / github.com/cli/cli / FetchLatestRelease

Function FetchLatestRelease

pkg/cmd/release/shared/fetch.go:216–219  ·  view source on GitHub ↗

FetchLatestRelease finds the latest published release for a repository.

(ctx context.Context, httpClient *http.Client, repo ghrepo.Interface)

Source from the content-addressed store, hash-verified

214
215// FetchLatestRelease finds the latest published release for a repository.
216func FetchLatestRelease(ctx context.Context, httpClient *http.Client, repo ghrepo.Interface) (*Release, error) {
217 path := fmt.Sprintf("repos/%s/%s/releases/latest", repo.RepoOwner(), repo.RepoName())
218 return fetchReleasePath(ctx, httpClient, repo.RepoHost(), path)
219}
220
221// fetchDraftRelease returns the first draft release that has tagName as its pending tag.
222func fetchDraftRelease(ctx context.Context, httpClient *http.Client, repo ghrepo.Interface, tagName string) (*Release, error) {

Callers 5

verifyRunFunction · 0.92
viewRunFunction · 0.92
isNewReleaseFunction · 0.92
verifyAssetRunFunction · 0.92
downloadRunFunction · 0.92

Calls 4

fetchReleasePathFunction · 0.85
RepoOwnerMethod · 0.65
RepoNameMethod · 0.65
RepoHostMethod · 0.65

Tested by

no test coverage detected