Skip to content

GITHUB_STEP_SUMMARY content silently dropped when size approaches the limit #4337

@idontsov

Description

@idontsov

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions