Beispiel #1
0
        /// <summary>
        ///     View the latest published full release for the repository. Draft releases and prereleases are not returned by this
        ///     endpoint.
        /// </summary>
        /// <param name="api"></param>
        /// <param name="repo"></param>
        /// <returns></returns>
        public static Release GetLatestRelease(this GitHubAPI api, [NotNull] RepoInfo repo)
        {
            string url = api.GetFullEndpointUrl("/repos/:owner/:repo/releases/latest", repo);

            return(api.DownloadJson <Release>(url));
        }
Beispiel #2
0
        /// <summary>
        ///     Get a published release with the specified tag.
        /// </summary>
        /// <param name="api"></param>
        /// <param name="repo"></param>
        /// <param name="tag"></param>
        /// <returns></returns>
        public static Release GetReleaseByTagName(this GitHubAPI api, [NotNull] RepoInfo repo, [NotNull] string tag)
        {
            string url = api.GetFullEndpointUrl($"/repos/:owner/:repo/releases/tags/{tag}", repo);

            return(api.DownloadJson <Release>(url));
        }