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

Commit 858a21d

Browse files
Checking the limits
1 parent a239db0 commit 858a21d

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)