Skip to content

Commit 2064f4b

Browse files
committed
Fix publishing of the wrong tag for drafts
1 parent 0c171e1 commit 2064f4b

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/Web/Webhook.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,8 +122,10 @@ protected override async ValueTask ProcessReleaseWebhookAsync(WebhookHeaders hea
122122
if (payload.Release.Draft)
123123
{
124124
await github.Repository.Release.Delete(repo.Owner.Login, repo.Name, payload.Release.Id);
125+
// In this case, the TagName will be a untagged thing, we use the release name instead.
126+
125127
var release = await github.Repository.Release.Create(repo.Owner.Login, repo.Name,
126-
new NewRelease(payload.Release.TagName)
128+
new NewRelease(payload.Release.Name)
127129
{
128130
Name = payload.Release.Name,
129131
Body = newBody,
@@ -157,7 +159,7 @@ protected override async ValueTask ProcessReleaseWebhookAsync(WebhookHeaders hea
157159
await base.ProcessReleaseWebhookAsync(headers, payload, action);
158160
}
159161

160-
async Task CreateReleaseDiscussion(ReleaseAction action, Octokit.Release release, string content, Octokit.Webhooks.Models.Repository repo, CancellationToken cancellationToken)
162+
async Task CreateReleaseDiscussion(Octokit.Release release, string content, Octokit.Webhooks.Models.Repository repo, CancellationToken cancellationToken)
161163
{
162164
if (config["SponsorLink:Account"] is string account)
163165
{

0 commit comments

Comments
 (0)