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

Function FetchLatestRelease

pkg/cmd/release/shared/fetch.go:228–231  ·  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

226
227// FetchLatestRelease finds the latest published release for a repository.
228func FetchLatestRelease(ctx context.Context, httpClient *http.Client, repo ghrepo.Interface) (*Release, error) {
229 path := fmt.Sprintf("repos/%s/%s/releases/latest", repo.RepoOwner(), repo.RepoName())
230 return fetchReleasePath(ctx, httpClient, repo.RepoHost(), path)
231}
232
233// fetchDraftRelease returns the first draft release that has tagName as its pending tag.
234func 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