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
Open
Conversation
|
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
957d42f to
6fb331c
Compare
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
897ae15 to
8d07671
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
output_to_fileboolean input that redirects all output to files and returns file paths as step outputs instead of contentgemini_debug— when enabled, output always goes to files regardless of debug modeoutput_mode(content/file) andartifacts_dir(path to gemini-artifacts/)Motivation
When
gemini_debugis 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 causesGITHUB_OUTPUTto 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, defaultfalse):true, redirects stdout/stderr to files (notee/console streaming)gemini-artifacts/stdout.log,gemini-artifacts/stderr.log) assummaryanderroroutputs instead of contentgemini_debug— the debug flag only controls whether--debugis passed to the CLINew outputs:
output_mode:"content"(default) or"file"— lets callers detect the mode programmaticallyartifacts_dir: absolute path togemini-artifacts/directoryRefactored execution block:
GEMINI_ARGSto avoid duplicating the gemini CLI invocation across branchesoutput_to_fileis checked first, independently ofgemini_debugtee-based streaming only applies whenoutput_to_fileis false andgemini_debugis trueBackwards compatibility: When
output_to_fileis not set orfalse, behavior is identical to today.