Skip to content

fix: Add file-based output mode to avoid exceeding GitHub Actions output limits#480

Open
michalszelagsonos wants to merge 4 commits intogoogle-github-actions:mainfrom
michalszelagsonos:feat/output-to-file
Open

fix: Add file-based output mode to avoid exceeding GitHub Actions output limits#480
michalszelagsonos wants to merge 4 commits intogoogle-github-actions:mainfrom
michalszelagsonos:feat/output-to-file

Conversation

@michalszelagsonos
Copy link

@michalszelagsonos michalszelagsonos commented Mar 11, 2026

Summary

Motivation

When gemini_debug is enabled, recent gemini-cli versions (post-0.25.x) significantly increased the volume of diagnostic output behind --debug (auth info, API request/error counts, retry events, loop detection). This causes GITHUB_OUTPUT to exceed the ~1MB platform limit, resulting in truncated or failed step outputs.

The gemini-artifacts/ directory already exists and is populated on every run — this change leverages it by returning file paths instead of dumping content into step outputs.

Changes

New input (output_to_file, default false):

  • When true, redirects stdout/stderr to files (no tee/console streaming)
  • Returns file paths (gemini-artifacts/stdout.log, gemini-artifacts/stderr.log) as summary and error outputs instead of content
  • Produces a compact job summary showing file sizes instead of full content
  • Works with or without gemini_debug — the debug flag only controls whether --debug is passed to the CLI

New outputs:

  • output_mode: "content" (default) or "file" — lets callers detect the mode programmatically
  • artifacts_dir: absolute path to gemini-artifacts/ directory

Refactored execution block:

  • Extracted GEMINI_ARGS to avoid duplicating the gemini CLI invocation across branches
  • output_to_file is checked first, independently of gemini_debug
  • The existing tee-based streaming only applies when output_to_file is false and gemini_debug is true

Backwards compatibility: When output_to_file is not set or false, behavior is identical to today.

@google-cla
Copy link

google-cla bot commented Mar 11, 2026

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

…tput limits

Add `output_to_file` input that redirects all output to files and returns
file paths as step outputs instead of content. When enabled with
`gemini_debug: true`, debug output goes to files without console streaming,
keeping GITHUB_OUTPUT well under the ~1MB platform limit.

New outputs: `output_mode` (content/file) and `artifacts_dir` (path to
gemini-artifacts/). Full backwards compatibility when not set.

Ref: google-github-actions#479
Check output_to_file first, independently of debug mode. The debug flag
only controls whether --debug is passed to gemini CLI. Also extract
command args to avoid duplicating the gemini invocation.

Ref: google-github-actions#479
Run `npm run docs` to update autogenerated sections with:
- output_to_file input
- output_mode and artifacts_dir outputs

Ref: google-github-actions#479
The GEMINI_ARGS variable caused word-splitting on the multi-line PROMPT
string, breaking the gemini CLI argument parsing. Use a separate
DEBUG_FLAG variable instead and keep "${PROMPT}" quoted in each
invocation.

Ref: google-github-actions#479
@michalszelagsonos michalszelagsonos changed the title feat: Add file-based output mode to avoid exceeding GitHub Actions output limits fix: Add file-based output mode to avoid exceeding GitHub Actions output limits Mar 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Add file-based output mode to avoid exceeding GitHub Actions output limits with debug enabled

1 participant