Skip to content

Fix GITHUB_STEP_SUMMARY size limit exceeded with non-ASCII characters#75

Merged
Tyrrrz merged 8 commits intoprimefrom
copilot/fix-github-step-summary-limit
May 2, 2026
Merged

Fix GITHUB_STEP_SUMMARY size limit exceeded with non-ASCII characters#75
Tyrrrz merged 8 commits intoprimefrom
copilot/fix-github-step-summary-limit

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 1, 2026

  • Fix TruncateSummary in GitHubWorkflow.cs: truncate by UTF-8 byte count instead of char count
  • Fix CreateSummaryAsync in GitHubWorkflow.cs: write truncated content to file
  • Update PowerKit to 1.2.0 and use string.TruncateBytes(int byteCount, Encoding?) from PowerKit
  • Remove custom StringExtensions.cs from Utils/Extensions/ (superseded by PowerKit)
  • Add tests for non-ASCII truncation in MtpSummarySpecs and VsTestSummarySpecs
  • Include newlines inside content before truncation so byte estimation is always accurate and the file never exceeds the limit
  • Rename fullContentactualContent in CreateSummaryAsync
  • Rename truncatedtruncatedContent in CreateSummaryAsync

Copilot AI linked an issue May 1, 2026 that may be closed by this pull request
5 tasks
Copilot AI changed the title [WIP] Fix GITHUB_STEP_SUMMARY limit with non-ASCII characters Fix GITHUB_STEP_SUMMARY size limit exceeded with non-ASCII characters May 1, 2026
Copilot AI requested a review from Tyrrrz May 1, 2026 13:41
Copilot finished work on behalf of Tyrrrz May 1, 2026 13:41
@Tyrrrz Tyrrrz added the bug Something isn't working label May 1, 2026
Comment thread GitHubActionsTestLogger/GitHub/GitHubWorkflow.cs Outdated
Copilot finished work on behalf of Tyrrrz May 1, 2026 13:56
Copilot AI requested a review from Tyrrrz May 1, 2026 13:56
@Tyrrrz
Copy link
Copy Markdown
Owner

Tyrrrz commented May 2, 2026

@copilot update PowerKit to 1.2.0 and use its newly introduced string.TruncateBytes method.

Copy link
Copy Markdown
Contributor Author

Copilot AI commented May 2, 2026

@copilot update PowerKit to 1.2.0 and use its newly introduced string.TruncateBytes method.

Done in fe46a5f. Updated PowerKit to 1.2.0 in Directory.Packages.props, removed the custom StringExtensions.cs, and updated GitHubWorkflow.cs to call content.TruncateBytes(availableSize, Encoding.UTF8) from PowerKit.

Copilot finished work on behalf of Tyrrrz May 2, 2026 12:05
@codecov
Copy link
Copy Markdown

codecov Bot commented May 2, 2026

Codecov Report

❌ Patch coverage is 77.77778% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 85.00%. Comparing base (a3b9120) to head (6aeba53).
⚠️ Report is 1 commits behind head on prime.

Files with missing lines Patch % Lines
GitHubActionsTestLogger/GitHub/GitHubWorkflow.cs 77.77% 0 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##            prime      #75      +/-   ##
==========================================
- Coverage   85.22%   85.00%   -0.22%     
==========================================
  Files          19       19              
  Lines         758      747      -11     
  Branches       85       85              
==========================================
- Hits          646      635      -11     
  Misses         59       59              
  Partials       53       53              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Tyrrrz Tyrrrz marked this pull request as ready for review May 2, 2026 12:12
Copilot AI review requested due to automatic review settings May 2, 2026 12:12
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes GitHub Actions step summary truncation so the 1 MiB limit is respected when summaries contain multi-byte (non-ASCII) characters, and ensures the truncated output is what actually gets written.

Changes:

  • Truncate summary content by UTF-8 byte budget (via PowerKit TruncateBytes) rather than by character index.
  • Write the computed truncated summary to GITHUB_STEP_SUMMARY (instead of the original content).
  • Add regression tests (VsTest + MTP) covering near-full summary files with CJK characters, and bump PowerKit to 1.2.0.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
GitHubActionsTestLogger/GitHub/GitHubWorkflow.cs Fixes truncation to be UTF-8 byte-aware and ensures truncated content is written.
GitHubActionsTestLogger.Tests/VsTestSummarySpecs.cs Adds a regression test for non-ASCII content near the summary size limit.
GitHubActionsTestLogger.Tests/MtpSummarySpecs.cs Adds a corresponding regression test for the MTP path.
Directory.Packages.props Updates PowerKit dependency to 1.2.0.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread GitHubActionsTestLogger/GitHub/GitHubWorkflow.cs Outdated
Comment thread GitHubActionsTestLogger/GitHub/GitHubWorkflow.cs Outdated
Copilot finished work on behalf of Tyrrrz May 2, 2026 12:24
This was referenced May 5, 2026
github-actions Bot pushed a commit to saan800/github that referenced this pull request May 6, 2026
…#249)

Updated
[GitHubActionsTestLogger](https://github.com/Tyrrrz/GitHubActionsTestLogger)
from 3.0.2 to 3.0.4.

<details>
<summary>Release notes</summary>

_Sourced from [GitHubActionsTestLogger's
releases](https://github.com/Tyrrrz/GitHubActionsTestLogger/releases)._

## 3.0.4

<!-- Release notes generated using configuration in .github/release.yml
at 3.0.4 -->

## What's Changed
### Enhancements
* Add PowerKit (prerelease), update PolyShim and CSharpier, remove
duplicate utilities by @​Copilot in
Tyrrrz/GitHubActionsTestLogger#72
### Bugs
* Explicitly dispose `summaryWriter` before reading file in truncation
tests by @​Copilot in
Tyrrrz/GitHubActionsTestLogger#76
* Fix GITHUB_STEP_SUMMARY size limit exceeded with non-ASCII characters
by @​Copilot in
Tyrrrz/GitHubActionsTestLogger#75


**Full Changelog**:
Tyrrrz/GitHubActionsTestLogger@3.0.3...3.0.4

## 3.0.3

## What's Changed
* Truncate or omit step summary when approaching GitHub's 1 MiB limit by
@​Copilot in Tyrrrz/GitHubActionsTestLogger#68
* Pin Microsoft.Testing.Platform reference to 2.0.0 by @​Copilot in
Tyrrrz/GitHubActionsTestLogger#70


**Full Changelog**:
Tyrrrz/GitHubActionsTestLogger@3.0.2...3.0.3

Commits viewable in [compare
view](Tyrrrz/GitHubActionsTestLogger@3.0.2...3.0.4).
</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

GITHUB_STEP_SUMMARY can exceed the limit with non-ASCII charactors

3 participants