GitHub Actions "Unable to process file command 'output' ... invalid format" in CI
Writing name=value to $GITHUB_OUTPUT only works for single-line values. A value containing a newline must use the heredoc form with a unique delimiter, or the runner rejects the file command as invalid format.
What this error means
A step fails with "Error: Unable to process file command 'output' successfully." and "Invalid format '<line>'" when it writes a multiline value to GITHUB_OUTPUT.
Error: Unable to process file command 'output' successfully.
Error: Invalid format 'line two of the value'Common causes
A multiline value written as name=value
The newline after the first line is read as the start of a new, malformed command line.
A delimiter that appears in the value
A heredoc whose end marker also occurs inside the value terminates early and corrupts the format.
How to fix it
Use the heredoc delimiter form
- Pick a delimiter that does not occur in the value (e.g. a random string).
- Write
name<<DELIM, the value, thenDELIMon its own line. - Re-run.
{
echo "notes<<EOF"
echo "line one"
echo "line two"
echo "EOF"
} >> "$GITHUB_OUTPUT"Use a random, unique delimiter
Generate a delimiter so it can never collide with the content.
EOF=$(openssl rand -hex 8)
echo "notes<<$EOF" >> "$GITHUB_OUTPUT"
cat notes.txt >> "$GITHUB_OUTPUT"
echo "$EOF" >> "$GITHUB_OUTPUT"How to prevent it
- Always use the heredoc form for multiline outputs.
- Choose a delimiter that cannot appear in the value.
- Avoid
set-output, which is deprecated.