Fix GITHUB_STEP_SUMMARY size limit exceeded with non-ASCII characters#75
Fix GITHUB_STEP_SUMMARY size limit exceeded with non-ASCII characters#75
Conversation
…content Agent-Logs-Url: https://github.com/Tyrrrz/GitHubActionsTestLogger/sessions/2fe79fc9-180b-4ae3-887f-146885aeef18 Co-authored-by: Tyrrrz <1935960+Tyrrrz@users.noreply.github.com>
…oding encoding) Agent-Logs-Url: https://github.com/Tyrrrz/GitHubActionsTestLogger/sessions/9626c539-9d2c-4c9c-a58f-18bae21bb6ed Co-authored-by: Tyrrrz <1935960+Tyrrrz@users.noreply.github.com>
|
@copilot update PowerKit to 1.2.0 and use its newly introduced |
Agent-Logs-Url: https://github.com/Tyrrrz/GitHubActionsTestLogger/sessions/c80cef8e-dbd2-4c7f-8234-152b35aa1f52 Co-authored-by: Tyrrrz <1935960+Tyrrrz@users.noreply.github.com>
Done in fe46a5f. Updated PowerKit to 1.2.0 in |
Codecov Report❌ Patch coverage is
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. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
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.
…udget Agent-Logs-Url: https://github.com/Tyrrrz/GitHubActionsTestLogger/sessions/e53c5649-7268-4e65-8cd0-be39935eb4b3 Co-authored-by: Tyrrrz <1935960+Tyrrrz@users.noreply.github.com>
…#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>
TruncateSummaryinGitHubWorkflow.cs: truncate by UTF-8 byte count instead of char countCreateSummaryAsyncinGitHubWorkflow.cs: write truncated content to filestring.TruncateBytes(int byteCount, Encoding?)from PowerKitStringExtensions.csfromUtils/Extensions/(superseded by PowerKit)fullContent→actualContentinCreateSummaryAsynctruncated→truncatedContentinCreateSummaryAsync