Skip to content

Commit

Permalink
Fix upload problem to coveralls (#40)
Browse files Browse the repository at this point in the history
  • Loading branch information
xoofx committed Aug 11, 2022
1 parent e5a8490 commit fc75e9f
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/dotnet-releaser/ReleaserApp.Coveralls.cs
Expand Up @@ -2,6 +2,7 @@
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Net.Http;
using System.Threading.Tasks;
using DotNetReleaser.Coverage.Coveralls;
Expand Down Expand Up @@ -100,7 +101,14 @@ private async Task PublishCoveralls(IDevHosting devHosting, BuildInformation bui
{
{ new StringContent(json), "json" }
};


// Credits fix from https://github.com/csMACnz/coveralls.net/issues/110#issuecomment-1203220933
var boundary = formData.Headers.ContentType?.Parameters.FirstOrDefault(o => o.Name == "boundary");
if (boundary != null)
{
boundary.Value = boundary.Value?.Replace("\"", string.Empty);
}

var postResponse = await httpClient.PostAsync(new Uri(baseUri, "/api/v1/jobs"), formData);

if (!postResponse.IsSuccessStatusCode)
Expand Down

0 comments on commit fc75e9f

Please sign in to comment.