actions / actions/runner

GITHUB_STEP_SUMMARY content silently dropped when size approaches the limit

Open
#4,337 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
C#
Stars
6.3k
Forks
1.4k
Avg merge
1d 16h
Merged PRs (30d)
24

Description

Describe the bug
According to the docs: "Job summaries are isolated between steps and each step is restricted to a maximum size of 1MiB". In reality, the limit seems to be (1MiB - 2) bytes of content, but that's not the point.

The main issue is: when the size of the summary is just below the limit, the summary is silently dropped without any error or warning.

To Reproduce

Run the following workflow:

name: gha-step-summary-silent-drop

on:
  workflow_dispatch:

defaults:
  run:
    shell: pwsh

jobs:
  # BUG: the summary content length is 1 byte less the limit, yet it gets rejected as 'too long'.
  bug-1:
    runs-on: windows-latest
    timeout-minutes: 5
    name: "bug-1: incorrect summary limit"
    steps:
      - name: Write summary
        run: |
          $content = "1234567`n" * 128 * 1024                             # 1MiB exactly
          $content = $content.Substring(0, $content.Length - 1)           # trim: we're one byte less than the limit
          $content = $content.Substring(0, $content.Length - 4) + ' END'  # insert end marker
          Write-Host "Trimmed content length: $($content.Length)"

          $content > $env:GITHUB_STEP_SUMMARY
          Write-Host "Summary content written to $env:GITHUB_STEP_SUMMARY"

  # BUG: the summary content length is 2 bytes less the limit, and the summary just not get written at all, no error, no warning, just nothing.
  bug-2:
    runs-on: windows-latest
    timeout-minutes: 5
    name: "bug-2: summary silently dropped"
    steps:
      - name: Write summary
        run: |
          $content = "1234567`n" * 128 * 1024                             # 1MiB exactly
          $content = $content.Substring(0, $content.Length - 2)           # trim: we're two bytes less than the limit
          $content = $content.Substring(0, $content.Length - 4) + ' END'  # insert end marker
          Write-Host "Trimmed content length: $($content.Length)"

          $content > $env:GITHUB_STEP_SUMMARY
          Write-Host "Summary content written to $env:GITHUB_STEP_SUMMARY"

You can see the workflow here: https://github.com/DevExpress/gha-step-summary-silent-drop/actions

Expected behavior
I expect the summary to either be accepted and displayed, or an error to be thrown. Currently, there is neither a summary nor an error.

Runner Version and Platform

Current runner version: '2.333.1'
windows-latest

What's not working?

  • The summary is not displayed
  • There is no error indicating what's wrong

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by running the provided gha-step-summary-silent-drop workflow on windows-latest and compare the two GITHUB_STEP_SUMMARY cases near the 1MiB limit. Trace the runner's handling of the summary file, then verify that near-limit content is displayed or produces an explicit error instead of being silently dropped.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp, powershell
Domain
ci-cd
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.