Skip to content

Commit

Permalink
[feat] Introduce NewRelease.DiscussionCategoryName, Fixes octokit#2746
Browse files Browse the repository at this point in the history
  • Loading branch information
AndreyAkinshin committed Dec 29, 2023
1 parent 7b7cfd3 commit dcaa4e3
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
9 changes: 9 additions & 0 deletions Octokit/Models/Request/NewRelease.cs
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,15 @@ public NewRelease(string tagName)
/// </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
Expand Down
12 changes: 12 additions & 0 deletions docs/releases.md
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down

0 comments on commit dcaa4e3

Please sign in to comment.