Skip to content

Large content is not passed to output job #28863

@JamesNK

Description

@JamesNK

I want to write a wiki page. I need to define my own safe output job to do that. However, it has started failing because the content exceeds a limit and I get a message that content is written to a file instead of the content I want. I'm attempting to work around this issue.

What is the best fix?

WIP markdown file:
https://github.com/microsoft/aspire/blob/update-gh-aw-v0.71.0/.github/workflows/milestone-changelog.md?plain=1

Current workaround (not yet verified):

              // Handle case where body exceeded the framework's inline size limit
              // and was saved to a separate file in /tmp/gh-aw/safeoutputs/
              const largeContentPrefix = '[Content too large, saved to file: ';
              if (body.startsWith(largeContentPrefix) && body.endsWith(']')) {
                const filename = body.slice(largeContentPrefix.length, -1);
                const contentFilePath = path.join('/tmp/gh-aw/safeoutputs', filename);
                if (!fs.existsSync(contentFilePath)) {
                  core.setFailed(`Referenced content file not found: ${contentFilePath}`);
                  return;
                }
                body = fs.readFileSync(contentFilePath, 'utf8');
                core.info(`Resolved body from external file (${body.length} bytes)`);
              }

Checking for text Content too large, saved to file feels very brittle.

Metadata

Metadata

Assignees

No one assigned

    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