-
Notifications
You must be signed in to change notification settings - Fork 39
Expand file tree
/
Copy pathIGitHubReleaseService.cs
More file actions
66 lines (57 loc) · 1.8 KB
/
IGitHubReleaseService.cs
File metadata and controls
66 lines (57 loc) · 1.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
// Licensed to Elasticsearch B.V under one or more agreements.
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
// See the LICENSE file in the project root for more information
namespace Elastic.Changelog.GitHub;
/// <summary>
/// Information about a GitHub release
/// </summary>
public record GitHubReleaseInfo
{
/// <summary>
/// The git tag name for this release (e.g., "v1.0.0")
/// </summary>
public string TagName { get; init; } = "";
/// <summary>
/// The release title/name
/// </summary>
public string Name { get; init; } = "";
/// <summary>
/// The release body containing release notes (markdown)
/// </summary>
public string Body { get; init; } = "";
/// <summary>
/// Whether this is marked as a prerelease
/// </summary>
public bool Prerelease { get; init; }
/// <summary>
/// Whether this is a draft release
/// </summary>
public bool Draft { get; init; }
/// <summary>
/// The URL to the release page on GitHub
/// </summary>
public string HtmlUrl { get; init; } = "";
/// <summary>
/// The date and time when this release was published on GitHub
/// </summary>
public DateTimeOffset? PublishedAt { get; init; }
}
/// <summary>
/// Service interface for fetching release information from GitHub
/// </summary>
public interface IGitHubReleaseService
{
/// <summary>
/// Fetches release information from GitHub
/// </summary>
/// <param name="owner">Repository owner</param>
/// <param name="repo">Repository name</param>
/// <param name="version">Version tag or "latest" (null defaults to latest)</param>
/// <param name="ctx">Cancellation token</param>
/// <returns>Release information or null if fetch fails</returns>
Task<GitHubReleaseInfo?> FetchReleaseAsync(
string owner,
string repo,
string? version,
CancellationToken ctx = default);
}