Skip to content

Commit fd3f522

Browse files
sethvargoiclectic
andauthored
Stream live output if (and only if) debug mode is enabled (#207)
This feels like a reasonable compromise between having no output at all. - Closes #203 (thanks @iclectic, your commit is in this PR) - Fixes #189 --------- Co-authored-by: iclectic <[email protected]> Co-authored-by: Ibim Braide <[email protected]>
1 parent 98a1cf8 commit fd3f522

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

action.yml

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -162,10 +162,19 @@ runs:
162162
}
163163
trap cleanup EXIT
164164
165-
# Run Gemini CLI with the provided prompt
165+
# Keep track of whether we've failed
166166
FAILED=false
167-
if ! gemini --yolo --prompt "${PROMPT}" 2> "${TEMP_STDERR}" 1> "${TEMP_STDOUT}"; then
168-
FAILED=true
167+
168+
# Run Gemini CLI with the provided prompt, streaming responses in debug
169+
if [[ -n "${DEBUG:-}" ]] || [[ -n "${ACTIONS_STEP_DEBUG:-}" ]]; then
170+
echo "::warning::Gemini CLI debug logging is enabled. This will stream responses, which could reveal sensitive information if processed with untrusted inputs."
171+
if ! { gemini --yolo --prompt "${PROMPT}" 2> >(tee "${TEMP_STDERR}" >&2) | tee "${TEMP_STDOUT}"; }; then
172+
FAILED=true
173+
fi
174+
else
175+
if ! gemini --yolo --prompt "${PROMPT}" 2> "${TEMP_STDERR}" 1> "${TEMP_STDOUT}"; then
176+
FAILED=true
177+
fi
169178
fi
170179
171180
GEMINI_RESPONSE="$(cat "${TEMP_STDOUT}")"

0 commit comments

Comments
 (0)