bug: EOF heredoc delimiter collision in GITHUB_OUTPUT causes step failure
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 65/100
Research direction
Inspect the output-writing blocks in action.yml, focusing on the gemini_response and gemini_errors heredoc delimiters used with GITHUB_OUTPUT. Reproduce with stderr or stdout containing EOF, then verify that the action accepts the outputs without treating embedded Gemini CLI text as raw output format.
Written by the indexing model from the issue text.
Description
TL;DR
The action uses EOF as the heredoc delimiter when writing gemini_response and gemini_errors to $GITHUB_OUTPUT. When Gemini CLI's stderr contains the substring EOF (e.g. from internal bash parser diagnostics like SCRIPT_EOF), it prematurely terminates the heredoc block. The remaining stderr content is then parsed as raw $GITHUB_OUTPUT format, which GitHub Actions rejects with:
##[error]Unable to process file command 'output' successfully.
##[error]Invalid format 'SCRIPT_EOF Syntax Errors: [ 'Error node: "<" at 0:0' ]'
This is related to #381, which reports the same underlying issue from a different angle (JSON output containing EOF leaking into the next output block).
Root Cause
In action.yml, the output blocks use EOF as the delimiter:
echo "gemini_errors<<EOF" >> "${GITHUB_OUTPUT}"
if [[ -n "${ERROR_JSON}" ]]; then
echo "${ERROR_JSON}" >> "${GITHUB_OUTPUT}"
else
cat "${TEMP_STDERR}" >> "${GITHUB_OUTPUT}"
fi
echo "EOF" >> "${GITHUB_OUTPUT}"
When TEMP_STDERR contains Gemini CLI's internal bash parser warnings (which include the string SCRIPT_EOF), the EOF at position 7 of SCRIPT_EOF matches the heredoc terminator on a line by itself, breaking the block.
The same issue applies to gemini_response<<EOF when stdout JSON happens to contain EOF on its own line.
Reproduction
This is intermittent — it depends on whether Gemini CLI's bash command parser emits syntax warnings containing EOF during a given run. More likely when the agent writes heredoc scripts (e.g. cat << 'SCRIPT_EOF' > file.py).
Observed on: run-gemini-cli@v0.1.21, still present on latest main (642deeb7).
Suggested Fix
Use a more unique delimiter that won't appear in Gemini CLI output:
echo "gemini_errors<<GEMINI_CLI_OUTPUT_DELIMITER" >> "${GITHUB_OUTPUT}"
...
echo "GEMINI_CLI_OUTPUT_DELIMITER" >> "${GITHUB_OUTPUT}"
Or use a random delimiter per run:
DELIMITER="GEMINI_EOF_$(openssl rand -hex 8)"
echo "gemini_errors<<${DELIMITER}" >> "${GITHUB_OUTPUT}"
...
echo "${DELIMITER}" >> "${GITHUB_OUTPUT}"
Environment
- Action version: v0.1.21
- Runner: ubuntu-latest
- Gemini model: gemini-3.1-pro-preview
- Dominant language
- TypeScript
- Stars
- 2.1k
- Forks
- 285
- Avg merge
- 8h 8m
- Merged PRs (30d)
- 1
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from google-github-actions/run-gemini-cli
-
Difficulty 1/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 1/5 Under an hour Newbie friendliness 85/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 1/5 Under an hour Newbie friendliness 78/100
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
All issues in google-github-actions/run-gemini-cli
Similar issues
-
comp/desktop P3 type/bug
Difficulty 1/5 Under an hour Newbie friendliness 92/100
NousResearch/hermes-agent#118866 ·
-
Browser Waiting for: Product Owner
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
getsentry/sentry-javascript#24577 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
agilepathway/label-checker#640 ·
-
Plugin stuck at "loading" on DSH 0.1.6-alpha.2 — turnTail list slot registration missing options.id Open
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
chrisparsons83/flexspotff#153 ·