[feat] Introduce NewRelease.DiscussionCategoryName, Fixes #2746

Co-authored-by: Nick Floyd <139819+nickfloyd@users.noreply.github.com>
This commit is contained in:
Andrey Akinshin
2024-01-02 22:51:21 +01:00
committed by GitHub
parent 0e386621d1
commit 48d061afd2
2 changed files with 21 additions and 0 deletions

View File

@@ -73,6 +73,15 @@ namespace Octokit
/// </value>
public bool Prerelease { get; set; }
/// <summary>
/// If specified, a discussion of the specified category is created and linked to the release.
/// The value must be a category that already exists in the repository.
/// <value>
/// The discussion category name.
/// </value>
/// </summary>
public string DiscussionCategoryName { get; set; }
/// <summary>
/// Gets or sets a value indicating whether to automatically generate the name and body for this release.
/// If <see cref="Name">name</see> is specified, the specified name will be used; otherwise, a name will

View File

@@ -55,6 +55,18 @@ newRelease.GenerateReleaseNotes = true; // Set for Name and Body to be generated
newRelease.TargetCommitish = "main"; // Optional, can be a branch, tag, or SHA; defaults to the main branch.
```
### Generate a discussion
Using the `DiscussionCategoryName`, it's possible to create a discussion linked to the upcoming release.
The value must be a category that already exists in the repository.
For more information, see "[Managing categories for discussions in your repository](https://docs.github.com/discussions/managing-discussions-for-your-community/managing-categories-for-discussions-in-your-repository)."
```csharp
var newTag = "v1.5.7";
var newRelease = new NewRelease(newTag);
newRelease.DiscussionCategoryName = "Announcements";
```
#### Customizing generated notes
```csharp
var newTag = "v1.5.7";