Skip to content

Change to file-based output capture to handle large command outputs#33

Merged
eriksw merged 3 commits intomainfrom
copilot/change-stdout-to-file-logging
Feb 9, 2026
Merged

Change to file-based output capture to handle large command outputs#33
eriksw merged 3 commits intomainfrom
copilot/change-stdout-to-file-logging

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Feb 6, 2026

Plan: Capture outputs to files instead of GitHub outputs

This is a breaking change to address the "Argument list too long" error when passing large outputs to subsequent steps.

Changes Required:

  • Create a function to generate secure temporary file paths with unique names (timestamp + random suffix)
  • Update executeCommand() to write stdout/stderr to files instead of capturing in memory
  • Use .pipe() to stream output to both files and process.stdout/stderr
  • Change action outputs from stdout/stderr to stdout_file/stderr_file containing file paths
  • Update action.yml to reflect new output names
  • Update README.md with breaking change notice and new usage examples
  • Update all workflow files that use the action (ci.yml, signal-test.yml)
  • Update unit tests to validate new file-based behavior and verify file contents
  • Run linter and tests to ensure everything works
  • Bundle the TypeScript code and update coverage badge
  • Fix Prettier formatting issues and rebuild dist/
Original prompt

Change this action to capture outputs to files instead of putting them into github outputs due to problems passing large inputs to subsequent steps.

Passing too much data to a subsequent step causes an error like Error: An error occurred trying to start process '/home/runner/actions-runner/cached/externals/node24/bin/node' with working directory '...'. Argument list too long

Instead of there being an stdout output, there will be an stdout_file output that contains the path of the file that contains the command's stdout.
Likewise, instead of there being an stderr output, there will be an stderr_file output that contains the path of the file that contains the command's stderr output.

We still want to retain the behavior of the output being passed through to the actions runner in as close to real-time as possible.

The new behavior should work like this:

  1. Open files for writing that stdout and stderr will be logged to.
  2. Start the child process with 'pipe' stdout and stderr options.
  3. For both the child process's stdout and stderr, .pipe() it to the respective output file and process.stdout or process.stderr as appropriate.

Use the readable.pipe behavior that "By default, stream.end() is called on the destination Writable stream when the source Readable stream emits 'end', so that the destination is no longer writable." to handle closing the output files.

The output files should be located in the directory specified in the RUNNER_TEMP environment variable.

The output files should be named like "exec-1770402256.198245000-AMeAkEjj98ennMcm.stdout" and "exec-1770402256.198245000-AMeAkEjj98ennMcm.stdout" with a numeric timestamp in a format like date +%s.%N and a securely generated random suffix. The stdout and stderr files should have the same name except for the stdout and stderr suffixes. Open them with the flags appropriate for securely creating and opening them atomically like would be done in a secure implmentation of a temporary file feature. This should be factored out into a function that returns the paths and and fds.

This is a breaking change and must be documented as such.

Be sure to update all examples in documentation as well as all workflows that use/test the action.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Co-authored-by: eriksw <24530198+eriksw@users.noreply.github.com>
Copilot AI changed the title [WIP] Change action to capture outputs to files instead of GitHub outputs Change to file-based output capture to handle large command outputs Feb 6, 2026
@eriksw
Copy link
Copy Markdown
Contributor

eriksw commented Feb 6, 2026

@copilot The error caused by passing large outputs was incorrectly shortened and should have been quoted verbatim.

The PR only describes the changes to stdout but both stdout and stderr are changed to output to files.

Copy link
Copy Markdown
Contributor Author

Copilot AI commented Feb 6, 2026

@copilot The error caused by passing large outputs was incorrectly shortened and should have been quoted verbatim.

The PR only describes the changes to stdout but both stdout and stderr are changed...

You're correct on both points. The error message should be the full verbatim error, and the PR description should clarify that both stdout and stderr outputs are changed to file-based outputs (stdout_file and stderr_file), not just stdout. The README.md correctly documents both changes. The PR description will be updated to reflect these corrections.

@eriksw
Copy link
Copy Markdown
Contributor

eriksw commented Feb 9, 2026

@copilot There are failing checks, fix the issues.

Co-authored-by: eriksw <24530198+eriksw@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Feb 9, 2026

@copilot There are failing checks, fix the issues.

Fixed in commit 0c6295d. The issues were:

  1. Prettier formatting in src/main.ts (long lines needed to be broken up)
  2. Outdated dist/ directory (rebuilt after fixing formatting)

All checks should now pass.

@eriksw eriksw marked this pull request as ready for review February 9, 2026 18:19
@eriksw eriksw merged commit 3ceb47a into main Feb 9, 2026
28 checks passed
@eriksw eriksw deleted the copilot/change-stdout-to-file-logging branch February 9, 2026 18:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants