bash "here-document delimited by end-of-file" in CI
bash never found the heredoc's closing delimiter, so it consumed the rest of the file as the document and warned that the heredoc was "delimited by end-of-file". The terminator must appear on its own line with no surrounding whitespace, unless you opened with <<-.
What this error means
A step warns "here-document at line N delimited by end-of-file (wanted `EOF')" and the commands after the heredoc silently became part of it, so they never ran.
script.sh: line 5: warning: here-document at line 3 delimited by
end-of-file (wanted `EOF')Common causes
The terminator is indented
A plain <<EOF requires the closing EOF at column zero. Leading spaces (common when the heredoc is inside an indented block) mean the terminator is not recognized.
The terminator is misspelled or missing
A typo (EOL vs EOF), a trailing space after EOF, or an entirely absent terminator makes bash read to the end of the file.
How to fix it
Place the terminator at column zero
The closing word must be alone on its line with no leading or trailing whitespace and spelled exactly like the opener.
cat <<EOF > config.env
KEY=value
EOFUse <<- to allow tab indentation
The <<- form strips leading tabs (not spaces) from the body and the terminator, so you can indent a heredoc inside a block with tabs.
if true; then
cat <<-EOF
indented body
EOF
fiHow to prevent it
- Keep heredoc terminators unindented, or use
<<-with tabs only. - Match the terminator spelling exactly, with no trailing space.
- Run
bash -nto catch an unterminated heredoc before it runs.