Skip to content

PMA-29082: Add file-based output mode to avoid exceeding GitHub Actions output limits#1

Merged
michalszelagsonos merged 8 commits intosonos-mainfrom
output-to-file
Mar 25, 2026
Merged

PMA-29082: Add file-based output mode to avoid exceeding GitHub Actions output limits#1
michalszelagsonos merged 8 commits intosonos-mainfrom
output-to-file

Conversation

@michalszelagsonos
Copy link
Copy Markdown
Collaborator

JIRA

Field Value
Ticket PMA-29082
Type Story
Status In Review

Description

Add an output_to_file boolean input to the run-gemini-cli GitHub Action that redirects all output to files and returns file paths as step outputs instead of content. This avoids exceeding the ~1MB GITHUB_OUTPUT limit when gemini_debug: true is enabled with recent gemini-cli versions (post-0.25.x) that produce significantly more diagnostic output (auth info, API request/error counts, retry events, loop detection).

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 DEBUG_FLAG 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.

These changes mirror upstream PR #480 applied to the Sonos fork.

Testing

  • The changes were tested in a bucky PR to verify the new behavior

…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 marked this pull request as ready for review March 23, 2026 09:45
@michalszelagsonos michalszelagsonos requested a review from a team as a code owner March 23, 2026 09:45
@michalszelagsonos michalszelagsonos merged commit 8b743f9 into sonos-main Mar 25, 2026
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.

3 participants