Skip to content
This repository was archived by the owner on Dec 3, 2019. It is now read-only.

Commit af8ca59

Browse files
Merge pull request #138 from justaprogrammer/text-images-on-every-submit
I think this is the fix
2 parents 30daf5f + 001fa8d commit af8ca59

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/BCC.Web/Services/CheckRunSubmissionService.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using System;
22
using System.IO.Abstractions;
3+
using System.Text;
34
using System.Threading.Tasks;
45
using BCC.Core.Model.CheckRunSubmission;
56
using JetBrains.Annotations;
@@ -56,6 +57,15 @@ public Task<CheckRun> SubmitAsync([NotNull] string owner, [NotNull] string repos
5657

5758
var createCheckRun = JsonConvert.DeserializeObject<CreateCheckRun>(readAllText);
5859

60+
if (createCheckRun.Summary != null)
61+
{
62+
var byteCount = Encoding.Unicode.GetByteCount(createCheckRun.Summary) / 1024.0;
63+
if (byteCount > 128.0)
64+
{
65+
throw new InvalidOperationException();
66+
}
67+
}
68+
5969
return _gitHubAppModelService.SubmitCheckRunAsync(owner, repository, sha, createCheckRun);
6070
}
6171
}

0 commit comments

Comments
 (0)