Skip to content

Check by hand: GitHub Mermaid limits, comment size, image attach with a workflow token #1065

Open

Description

@lex00

Several facts the action depends on are not in GitHub's documentation. This issue measures them on a real repository so the Mermaid budget and the action's fallbacks rest on measured behaviour. It writes no product code. Part of #1049, phase 1. Filed here under surface:action; it moves to behold-action when that repo exists.

Today

From the forge scoping report, 2026-11-14.

  • Mermaid's own defaults are maxTextSize 50,000 and maxEdges 500, with securityLevel strict. Past maxTextSize Mermaid shows "Maximum text size in diagram exceeded"; past maxEdges it reports a vague syntax error (third-party source). GitHub states no size or complexity limit for Mermaid and does not say which values its renderer sets. Unverified.
  • Mermaid rendering in job summaries is shown only by third-party posts. Unverified.
  • The pull request comment limit of 65,536 characters ("Body is too long (maximum is 65536 characters)") comes from third-party sources only. Unverified.
  • gh pr comment --attach <file> uploads an image into a comment for users with push access, and SVG, PNG, GIF and JPEG are supported up to 10 MB (GitHub docs). Whether it works with a workflow's GITHUB_TOKEN is not stated. Unverified.
  • Whether a job summary is written on a fork's pull_request run is unverified.

Change

On a public test repository, with a workflow and generated inputs:

  • Post Mermaid flowcharts of 50, 200 and 500 edges, and of growing character counts, in a comment and in a job summary. Record where each stops rendering and what it shows.
  • Post comment bodies just under and just over 65,536 characters.
  • Run gh pr comment --attach on an SVG and a PNG with GITHUB_TOKEN, with pull-requests: write.
  • Open a pull request from a fork and check whether the job summary appears.

Write the results as a comment on this issue, with links to the runs.

Done when

  • The comment gives the largest Mermaid input that rendered in a comment and in a summary, in characters and edges.
  • It gives the exact comment size limit observed and the error text.
  • It says whether --attach worked with GITHUB_TOKEN, with the run link.
  • It says whether a fork run wrote a summary.
  • The github budget in the Mermaid emitter is set from these numbers.

Depends on

Nothing. It can run as soon as phase 1 starts.

Activity

  1. added
    wave:1
    epic:surfaces
    surface:action
    on Nov 15, 2026
  2. lex00 commented on Nov 15, 2026

    @lex00
    ContributorAuthor

    Measured on the public test repository INTENTIUS/behold-sandbox, using the limits workflow and one pull request that holds only the test comments (INTENTIUS/behold-sandbox#1). The runs are https://github.com/INTENTIUS/behold-sandbox/actions/runs/43772156713, https://github.com/INTENTIUS/behold-sandbox/actions/runs/43774140622 and https://github.com/INTENTIUS/behold-sandbox/actions/runs/43774430875.

    Done when:

    • Largest Mermaid input that rendered in a comment: 500 edges drew (Limits probe comments behold-sandbox#1 (comment)). 501 edges and 1,000 edges showed "Unable to render rich display" (Limits probe comments behold-sandbox#1 (comment)). A source of 260,000 characters drew (Limits probe comments behold-sandbox#1 (comment)), so GitHub does not apply Mermaid's 50,000 maxTextSize. The edge count is the only limit found below the comment size limit.
    • Largest input that rendered in a job summary: not read. Every case was written to a summary, from 50 to 1,000 edges and up to 500,000 characters. A signed-out browser cannot open a run summary, so the rendering is unchecked. The cases are on the first run above, and a signed-in person can open it and note which ones draw. One limit did show up. A summary step over 1,024 KiB is refused with "$GITHUB_STEP_SUMMARY upload aborted, supports content up to a size of 1024k, got 1074k" (1,100,112 bytes written).
    • Exact comment size limit: a body of 262,144 characters was accepted and 262,145 was refused. The error text still reads "Body is too long (maximum is 65536 characters)", so the documented figure is four times too low. Bodies of 65,535, 65,536 and 65,537 characters were all accepted.
    • gh pr comment --attach with GITHUB_TOKEN does not work. With pull-requests: write and issues: write it fails for an SVG and for a PNG with "attaching files requires write access to the repository". Adding contents: write changes nothing. The runner's gh was 2.103.3, which has the flag. Runs: the attach job of the first run, and the attach-contents-write job of https://github.com/INTENTIUS/behold-sandbox/actions/runs/43774140622.
    • A fork run writing a summary: not done, since forking is ruled out for this work. A person with a second account can fork INTENTIUS/behold-sandbox, open a pull request and look at the run.
    • The github budget is set from these numbers: blockChars 200,000, maxEdges 500, commentChars 262,144 and confirmed: true, with a test. The change is on branch estate/sandbox-runs of INTENTIUS/behold.

    The forgejo row is unchanged and still provisional.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    epic:surfacessurface:actionwave:1

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions